summaryrefslogtreecommitdiffstats
path: root/system/nvidia-legacy304-kernel/4.15_kernel.patch
blob: fdac62fb24b43ac9f5f8f93c26cef7ec5dbe0bd4 (plain)
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");