[PATCH] ath79: fix MikroTik CPLD driver build error on kernel 6.1

Shiji Yang yangshiji66 at outlook.com
Fri Sep 8 19:42:20 PDT 2023


From: Shiji Yang <yangshiji66 at qq.com>

Since kernel 5.18, the return type in device remove function has
changed from 'int' to 'void'.

Signed-off-by: Shiji Yang <yangshiji66 at qq.com>
---
 target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c b/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c
index da18424c63..f10ddef9e2 100644
--- a/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c
+++ b/target/linux/ath79/files/drivers/mfd/rb4xx-cpld.c
@@ -22,6 +22,7 @@
 #include <linux/spi/spi.h>
 #include <linux/module.h>
 #include <linux/of_platform.h>
+#include <linux/version.h>
 
 #include <mfd/rb4xx-cpld.h>
 
@@ -151,9 +152,14 @@ static int rb4xx_cpld_probe(struct spi_device *spi)
 				    NULL, 0, NULL);
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0)
+static void rb4xx_cpld_remove(struct spi_device *spi)
+{
+#else
 static int rb4xx_cpld_remove(struct spi_device *spi)
 {
 	return 0;
+#endif
 }
 
 static const struct of_device_id rb4xx_cpld_dt_match[] = {
-- 
2.39.2




More information about the openwrt-devel mailing list