diff options
author | Daniel Golle <daniel@makrotopia.org> | 2023-07-08 14:46:18 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2023-07-08 15:10:12 +0100 |
commit | 0f9e8baa9ec38288c587893667ac4d103ccd7bfe (patch) | |
tree | b5311b850690ccd318abc8b42e2479e34585d735 /package/kernel/leds-ws2812b/src | |
parent | 6b52a9b7520e6982c4876d792b10ad8771dc7f1b (diff) |
kernel: leds-ws2812b: fix build with Linux >= 5.18
The return value of the .remove function pointer has changed from
int to void with Linux 5.18. Use a precompiler macro to allow building
the leds-ws2812b module with both, Linux 5.15 and Linux 6.1.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/kernel/leds-ws2812b/src')
-rw-r--r-- | package/kernel/leds-ws2812b/src/leds-ws2812b.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/package/kernel/leds-ws2812b/src/leds-ws2812b.c b/package/kernel/leds-ws2812b/src/leds-ws2812b.c index b0d13f5242..0dba128c1f 100644 --- a/package/kernel/leds-ws2812b/src/leds-ws2812b.c +++ b/package/kernel/leds-ws2812b/src/leds-ws2812b.c @@ -17,6 +17,7 @@ #include <linux/property.h> #include <linux/spi/spi.h> #include <linux/mutex.h> +#include <linux/version.h> #define WS2812B_BYTES_PER_COLOR 3 #define WS2812B_NUM_COLORS 3 @@ -191,7 +192,11 @@ ERR_UNREG_LEDS: return ret; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0) +static void ws2812b_remove(struct spi_device *spi) +#else static int ws2812b_remove(struct spi_device *spi) +#endif { struct ws2812b_priv *priv = spi_get_drvdata(spi); int cur_led; @@ -201,7 +206,9 @@ static int ws2812b_remove(struct spi_device *spi) kfree(priv->data_buf); mutex_destroy(&priv->mutex); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) return 0; +#endif } static const struct spi_device_id ws2812b_spi_ids[] = { |