[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201210135657.1435-1-zhengyongjun3@huawei.com>
Date: Thu, 10 Dec 2020 21:56:57 +0800
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <pavel@....cz>, <dmurphy@...com>, <linux-leds@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: Zheng Yongjun <zhengyongjun3@...wei.com>
Subject: [PATCH -next] drivers: leds: simplify the return expression of register_nasgpio_led()
Simplify the return expression.
Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
---
drivers/leds/leds-ss4200.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/leds/leds-ss4200.c b/drivers/leds/leds-ss4200.c
index 245de443fe9c..97abab439826 100644
--- a/drivers/leds/leds-ss4200.c
+++ b/drivers/leds/leds-ss4200.c
@@ -478,7 +478,6 @@ ATTRIBUTE_GROUPS(nasgpio_led);
static int register_nasgpio_led(int led_nr)
{
- int ret;
struct nasgpio_led *nas_led = &nasgpio_leds[led_nr];
struct led_classdev *led = get_classdev_for_led_nr(led_nr);
@@ -489,11 +488,8 @@ static int register_nasgpio_led(int led_nr)
led->brightness_set = nasgpio_led_set_brightness;
led->blink_set = nasgpio_led_set_blink;
led->groups = nasgpio_led_groups;
- ret = led_classdev_register(&nas_gpio_pci_dev->dev, led);
- if (ret)
- return ret;
- return 0;
+ return led_classdev_register(&nas_gpio_pci_dev->dev, led);
}
static void unregister_nasgpio_led(int led_nr)
--
2.22.0
Powered by blists - more mailing lists