[openwrt/openwrt] kernel: ubnt-ledbar: return directly

LEDE Commits lede-commits at lists.infradead.org
Thu Oct 3 07:40:21 PDT 2024


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/d3e5a4d0a1e71db187f21b361840ce213b912009

commit d3e5a4d0a1e71db187f21b361840ce213b912009
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Wed Sep 25 14:43:14 2024 -0700

    kernel: ubnt-ledbar: return directly
    
    Removes ret variable.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/16508
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c b/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
index 8508804e21..52b33ef43d 100644
--- a/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
+++ b/package/kernel/ubnt-ledbar/src/leds-ubnt-ledbar.c
@@ -149,7 +149,6 @@ static int ubnt_ledbar_init_led(struct device_node *np, struct ubnt_ledbar *ledb
 				struct led_classdev *led_cdev)
 {
 	struct led_init_data init_data = {};
-	int ret;
 
 	if (!np)
 		return 0;
@@ -158,12 +157,7 @@ static int ubnt_ledbar_init_led(struct device_node *np, struct ubnt_ledbar *ledb
 
 	led_cdev->max_brightness = UBNT_LEDBAR_MAX_BRIGHTNESS;
 
-	ret = devm_led_classdev_register_ext(&ledbar->client->dev, led_cdev,
-					     &init_data);
-	if (ret)
-		dev_err(&ledbar->client->dev, "led register err: %d\n", ret);
-
-	return ret;
+	return devm_led_classdev_register_ext(&ledbar->client->dev, led_cdev, &init_data);
 }
 
 static int ubnt_ledbar_probe(struct i2c_client *client)




More information about the lede-commits mailing list