1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
diff -ur a/kernel/nv.c b/kernel/nv.c
--- a/kernel/nv.c 2017-09-14 23:51:09.000000000 +0300
+++ b/kernel/nv.c 2018-02-13 14:56:42.289490885 +0200
@@ -301,7 +301,11 @@
#else
irqreturn_t nv_kern_isr(int, void *);
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void nv_kern_rc_timer(unsigned long);
+#else
+void nv_kern_rc_timer(struct timer_list *t);
+#endif
#if defined(NV_PM_SUPPORT_OLD_STYLE_APM)
static int nv_kern_apm_event(struct pm_dev *, pm_request_t, void *);
#endif
@@ -2075,10 +2079,18 @@
}
void nv_kern_rc_timer(
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
unsigned long data
+#else
+ struct timer_list *t
+#endif
)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
nv_linux_state_t *nvl = (nv_linux_state_t *) data;
+#else
+ nv_linux_state_t *nvl = from_timer(nvl, t, rc_timer);
+#endif
nv_state_t *nv = NV_STATE_PTR(nvl);
NV_CHECK_PCI_CONFIG_SPACE(nvl->timer_sp, nv, TRUE, TRUE, FALSE);
@@ -3029,9 +3041,13 @@
return -1;
nv_printf(NV_DBG_INFO, "NVRM: initializing rc timer\n");
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
init_timer(&nvl->rc_timer);
nvl->rc_timer.function = nv_kern_rc_timer;
nvl->rc_timer.data = (unsigned long) nv;
+#else
+ timer_setup(&nvl->rc_timer, nv_kern_rc_timer, 0);
+#endif
nv->rc_timer_enabled = 1;
mod_timer(&nvl->rc_timer, jiffies + HZ); /* set our timeout for 1 second */
nv_printf(NV_DBG_INFO, "NVRM: rc timer initialized\n");
|