From: Aleksander Jan Bajkowski Date: Thu, 13 Jun 2024 21:15:39 +0000 (+0200) Subject: kernel: ltq-adsl: fix compilation warning on 6.6 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1b846fe208f96763650400ce56ae0c34a44d8612;p=openwrt%2Fstaging%2Fxback.git kernel: ltq-adsl: fix compilation warning on 6.6 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 --- diff --git a/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch b/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch index 1e860010e9..db02ebf4fd 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch @@ -111,12 +111,16 @@ 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; } diff --git a/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch b/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch index e1dc254ec0..7bbcf35cd2 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch @@ -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*/ diff --git a/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch b/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch index 93c2f67796..1fbc5d13ab 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch @@ -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; } @@ -104,7 +104,7 @@ { 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,