OSDN Git Service

Fix building errors with kernel < 4.11
[android-x86/external-kernel-drivers.git] / wl / linux-415.patch
1 diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
2 index 1270d6da22ba..ec120cf7d74c 100644
3 --- a/src/wl/sys/wl_linux.c
4 +++ b/src/wl/sys/wl_linux.c
5 @@ -93,7 +93,11 @@
6  
7  #include <wlc_wowl.h>
8  
9 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
10 +static void wl_timer(struct timer_list *tl);
11 +#else
12  static void wl_timer(ulong data);
13 +#endif
14  static void _wl_timer(wl_timer_t *t);
15  static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
16  
17 @@ -2300,10 +2304,17 @@
18         atomic_dec(&t->wl->callbacks);
19  }
20  
21 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
22 +static void
23 +wl_timer(struct timer_list *tl)
24 +{
25 +       wl_timer_t *t = (wl_timer_t *)tl;
26 +#else
27  static void
28  wl_timer(ulong data)
29  {
30         wl_timer_t *t = (wl_timer_t *)data;
31 +#endif
32  
33         if (!WL_ALL_PASSIVE_ENAB(t->wl))
34                 _wl_timer(t);
35 @@ -2355,9 +2366,13 @@
36  
37         bzero(t, sizeof(wl_timer_t));
38  
39 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
40 +       timer_setup(&t->timer, wl_timer, 0);
41 +#else
42         init_timer(&t->timer);
43         t->timer.data = (ulong) t;
44         t->timer.function = wl_timer;
45 +#endif
46         t->wl = wl;
47         t->fn = fn;
48         t->arg = arg;