aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel
diff options
context:
space:
mode:
authorTomasz Maciej Nowak <tmn505@gmail.com>2023-04-27 16:34:48 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2023-05-24 00:56:35 +0200
commit3d63bf4da7254de27191674ee79d884ac4a5b611 (patch)
tree03bddcdc6667a23956f9677762f105bebd570889 /package/kernel
parent957f1ee85eb243c5c7397b1e3842a3c61a6b852f (diff)
downloadupstream-3d63bf4da7254de27191674ee79d884ac4a5b611.tar.gz
upstream-3d63bf4da7254de27191674ee79d884ac4a5b611.tar.bz2
upstream-3d63bf4da7254de27191674ee79d884ac4a5b611.zip
ubnt-ledbar: add kernel 6.1 compat
As of ed5c2f5fd10d ("i2c: Make remove callback return void") return value of remove function is ignored. Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Diffstat (limited to 'package/kernel')
-rw-r--r--package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c b/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
index 555340c5e87..ee9d34601c6 100644
--- a/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
+++ b/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
@@ -9,6 +9,7 @@
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/gpio/consumer.h>
+#include <linux/version.h>
/**
* Driver for the Ubiquiti RGB LED controller (LEDBAR).
@@ -218,13 +219,19 @@ static int ubnt_ledbar_probe(struct i2c_client *client,
return ubnt_ledbar_apply_state(ledbar);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
static int ubnt_ledbar_remove(struct i2c_client *client)
+#else
+static void ubnt_ledbar_remove(struct i2c_client *client)
+#endif
{
struct ubnt_ledbar *ledbar = i2c_get_clientdata(client);
mutex_destroy(&ledbar->lock);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
return 0;
+#endif
}
static const struct i2c_device_id ubnt_ledbar_id[] = {