Message ID | TYAP286MB0315312AA0050C29E864A395BCECA@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM |
---|---|
State | Accepted, archived |
Headers | show |
Series | ath79: fix MikroTik CPLD driver build error on kernel 6.1 | expand |
Hi, On Sat, 9 Sept 2023 at 04:44, Shiji Yang <yangshiji66@outlook.com> wrote: > > From: Shiji Yang <yangshiji66@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@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 I'm pretty sure having a remove callback is optional, so why not just delete it since it doesn't do anything anyway? If we ever need one, we can just add one again. Best Regards, Jonas
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[] = {