summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2021-08-16 08:47:08 +0200
committerPavel Machek <pavel@ucw.cz>2021-08-16 08:47:08 +0200
commit654933ae7d32f278eecd0bb0f175785574ac4775 (patch)
tree9d1c717260fbead8a2c61a6a02bb5e162c191321 /drivers/leds
parentleds: lgm-sso: Propagate error codes from callee to caller (diff)
downloadlinux-654933ae7d32f278eecd0bb0f175785574ac4775.tar.xz
linux-654933ae7d32f278eecd0bb0f175785574ac4775.zip
leds: flash: Remove redundant initialization of variable ret
Adjust initialization not to trigger Coverity warnings. Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/led-class-flash.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/leds/led-class-flash.c b/drivers/leds/led-class-flash.c
index 6eeb9effcf65..185e17055317 100644
--- a/drivers/leds/led-class-flash.c
+++ b/drivers/leds/led-class-flash.c
@@ -92,14 +92,12 @@ static ssize_t flash_strobe_store(struct device *dev,
struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev);
unsigned long state;
- ssize_t ret = -EINVAL;
+ ssize_t ret = -EBUSY;
mutex_lock(&led_cdev->led_access);
- if (led_sysfs_is_disabled(led_cdev)) {
- ret = -EBUSY;
+ if (led_sysfs_is_disabled(led_cdev))
goto unlock;
- }
ret = kstrtoul(buf, 10, &state);
if (ret)