kernel: ltq-adsl: fix compilation warning on 6.6
authorAleksander Jan Bajkowski <olek2@wp.pl>
Thu, 13 Jun 2024 21:15:39 +0000 (23:15 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 14 Jun 2024 12:32:28 +0000 (14:32 +0200)
Fix compilation warning:
./include/linux/export.h:29:22: error: passing argument 1 of 'class_create' from incompatible pointer type [-Werror=incompatible-pointer-types]
   29 | #define THIS_MODULE (&__this_module)
      |                     ~^~~~~~~~~~~~~~~
      |                      |
      |                      struct module *
/home/aleksander/workspace/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-dsl-ar9/drv_dsl_cpe_api-3.24.4.4/src/common/drv_dsl_cpe_os_linux.c:1105:29: note: in expansion of macro 'THIS_MODULE'
 1105 |    dsl_class = class_create(THIS_MODULE, "dsl_cpe_api");
      |                             ^~~~~~~~~~~
In file included from ./include/linux/device.h:31,
                 from ./include/linux/platform_device.h:13,
                 from ./include/linux/of_device.h:5,
                 from ./include/linux/of_platform.h:10,
                 from /home/aleksander/workspace/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-dsl-ar9/drv_dsl_cpe_api-3.24.4.4/src/common/drv_dsl_cpe_os_linux.c:15:
./include/linux/device/class.h:230:54: note: expected 'const char *' but argument is of type 'struct module *'
  230 | struct class * __must_check class_create(const char *name);
      |                                          ~~~~~~~~~~~~^~~~
/home/aleksander/workspace/openwrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-dsl-ar9/drv_dsl_cpe_api-3.24.4.4/src/common/drv_dsl_cpe_os_linux.c:1105:16: error: too many arguments to function 'class_>
 1105 |    dsl_class = class_create(THIS_MODULE, "dsl_cpe_api");
      |                ^~~~~~~~~~~~
./include/linux/device/class.h:230:29: note: declared here
  230 | struct class * __must_check class_create(const char *name);
      |                             ^~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch
package/kernel/lantiq/ltq-adsl/patches/120-platform.patch
package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch

index 1e860010e91c3267301b14ed9fe689fbae241e02..db02ebf4fdb237a3ec934b91561d2edcf6f5fa69 100644 (file)
     DSL_int_t i;
  
     printk(DSL_DRV_CRLF DSL_DRV_CRLF "Infineon CPE API Driver version: %s" DSL_DRV_CRLF,
-@@ -1104,7 +1119,8 @@ int __init DSL_ModuleInit(void)
+@@ -1104,7 +1119,12 @@ int __init DSL_ModuleInit(void)
     }
  
     DSL_DRV_DevNodeInit();
 -
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
 +   dsl_class = class_create(THIS_MODULE, "dsl_cpe_api");
++#else
++   dsl_class = class_create("dsl_cpe_api");
++#endif
 +   device_create(dsl_class, NULL, MKDEV(DRV_DSL_CPE_API_DEV_MAJOR, 0), NULL, "dsl_cpe_api");
     return 0;
  }
index e1dc254ec0536cd25490b53d0f14d81fdc2d5458..7bbcf35cd2834cce2d7616aeaab904ebfe792a9c 100644 (file)
@@ -18,7 +18,7 @@
  {
     struct class *dsl_class;
     DSL_int_t i;
-@@ -1124,7 +1124,7 @@ int __init DSL_ModuleInit(void)
+@@ -1128,7 +1128,7 @@ int __init DSL_ModuleInit(void)
     return 0;
  }
  
@@ -27,7 +27,7 @@
  {
     printk("Module will be unloaded"DSL_DRV_CRLF);
  
-@@ -1139,7 +1139,7 @@ void __exit DSL_ModuleCleanup(void)
+@@ -1143,7 +1143,7 @@ void __exit DSL_ModuleCleanup(void)
                 (DSL_uint8_t**)&g_BndFpgaBase);
  #endif /* defined(INCLUDE_DSL_CPE_API_VINAX) && defined(INCLUDE_DSL_BONDING)*/
  
@@ -36,7 +36,7 @@
  }
  
  #ifndef _lint
-@@ -1155,8 +1155,30 @@ module_param(debug_level, byte, 0);
+@@ -1159,8 +1159,30 @@ module_param(debug_level, byte, 0);
  MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs");
  #endif /* #ifndef DSL_DEBUG_DISABLE*/
  
index 93c2f67796ac875a6fa804af7b8e310ad5145ed7..1fbc5d13ab927a3cb83887552f7cadd7d4822e31 100644 (file)
@@ -95,7 +95,7 @@
        &(dsl_cpe_api_version[4]));
  
     DSL_DRV_MemSet( ifxDevices, 0, sizeof(DSL_devCtx_t) * DSL_DRV_MAX_DEVICE_NUMBER );
-@@ -1124,7 +1099,7 @@ static int __devinit ltq_adsl_probe(stru
+@@ -1128,7 +1103,7 @@ static int __devinit ltq_adsl_probe(stru
     return 0;
  }
  
  {
     printk("Module will be unloaded"DSL_DRV_CRLF);
  
-@@ -1169,7 +1144,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match);
+@@ -1173,7 +1148,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match);
  
  static struct platform_driver ltq_adsl_driver = {
        .probe = ltq_adsl_probe,