diff mbox series

[5/6] ubnt-ledbar: add kernel 6.1 compat

Message ID 20230427143449.8286-6-tmn505@terefe.re
State Accepted
Headers show
Series Preparation for kernel 6.1 | expand

Commit Message

Tomasz Maciej Nowak April 27, 2023, 2:34 p.m. UTC
From: Tomasz Maciej Nowak <tmn505@gmail.com>

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>
---
 package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c b/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
index 555340c5e87f..ee9d34601c6f 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[] = {