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>
This commit is contained in:
Tomasz Maciej Nowak 2023-04-27 16:34:48 +02:00 committed by Christian Marangi
parent 957f1ee85e
commit 3d63bf4da7
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7

View File

@ -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[] = {