From 7b605254b7599d1a82920d0618cea0f839e11936 Mon Sep 17 00:00:00 2001
From: coolsnowwolf <coolsnowwolf@gmail.com>
Date: Thu, 24 Oct 2024 23:20:04 +0800
Subject: [PATCH] ubnt-ledbar: adapt for kernel v6.1

---
 package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c b/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
index c36a74779..d5c10ced6 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).
@@ -160,7 +161,12 @@ static int ubnt_ledbar_init_led(struct device_node *np, struct ubnt_ledbar *ledb
 	return devm_led_classdev_register_ext(&ledbar->client->dev, led_cdev, &init_data);
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
+static int ubnt_ledbar_probe(struct i2c_client *client,
+			     const struct i2c_device_id *id)
+#else
 static int ubnt_ledbar_probe(struct i2c_client *client)
+#endif
 {
 	struct device_node *np = client->dev.of_node;
 	struct ubnt_ledbar *ledbar;