ltq-vdsl: add kernel 5.0 compatibility
authorMathias Kresin <dev@kresin.me>
Sun, 7 Jul 2019 15:14:07 +0000 (17:14 +0200)
committerMathias Kresin <dev@kresin.me>
Sat, 20 Jul 2019 19:51:43 +0000 (21:51 +0200)
Signed-off-by: Mathias Kresin <dev@kresin.me>
package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch

index a8ce61fa36c69c18e36536f3e0713f348beb147c..7bcebe1e1c5556176ab96a458b7c6388152d9212 100644 (file)
  #endif
  
     if (pINode == DSL_NULL)
-@@ -1203,6 +1197,9 @@ static void DSL_DRV_NlSendMsg(DSL_char_t
+@@ -917,11 +911,18 @@ DSL_int32_t DSL_DRV_ThreadShutdown(
+ DSL_uint32_t DSL_DRV_SysTimeGet(DSL_uint32_t nOffset)
+ {
+-   struct timeval tv;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
++   struct timeval tv
++#else
++   struct timeval tv = ktime_to_timeval(ktime_get_real());
++#endif
+    DSL_uint32_t nTime = 0;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
+    memset(&tv, 0, sizeof(tv));
+    do_gettimeofday(&tv);
++#endif
++
+    nTime = (DSL_uint32_t)tv.tv_sec;
+    if ( (nOffset == 0) || (nOffset > nTime) )
+@@ -1203,6 +1204,9 @@ static void DSL_DRV_NlSendMsg(DSL_char_t
  }
  #endif
  
@@ -45,7 +65,7 @@
  /* Entry point of driver */
  int __init DSL_ModuleInit(void)
  {
-@@ -1241,6 +1238,10 @@ int __init DSL_ModuleInit(void)
+@@ -1241,6 +1245,10 @@ int __init DSL_ModuleInit(void)
  
     DSL_DRV_DevNodeInit();
  
@@ -56,7 +76,7 @@
     return 0;
  }
  
-@@ -1248,6 +1249,11 @@ void __exit DSL_ModuleCleanup(void)
+@@ -1248,6 +1256,11 @@ void __exit DSL_ModuleCleanup(void)
  {
     printk("Module will be unloaded"DSL_DRV_CRLF);