sllin: switch to updated upstream
[AGL/meta-agl-demo.git] / recipes-kernel / sllin / sllin / 0002-5.4-less-than-110-fix.patch
1 Fix compilation against kernels < 5.4.110
2
3 The fix to handle the backport of 4e096a18 to linux-5.4.y is a bit
4 too broad, as it breaks building against kernels older than 5.4.110,
5 add a version check to fix.
6
7 Upstream-Status: pending
8 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
9
10 diff --git a/sllin/sllin.c b/sllin/sllin.c
11 index b3f2636..a6fb120 100644
12 --- a/sllin/sllin.c
13 +++ b/sllin/sllin.c
14 @@ -1604,7 +1604,11 @@ static struct sllin *sll_alloc(dev_t line)
15         sl = netdev_priv(dev);
16         #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
17                 can_ml = (void *)sl + ALIGN(sizeof(*sl), NETDEV_ALIGN);
18 +       #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 110)
19                 can_set_ml_priv(dev, can_ml);
20 +       #else
21 +               dev->ml_priv = can_ml;
22 +       #endif
23         #endif
24         /* Initialize channel control data */
25         sl->magic = SLLIN_MAGIC;