summaryrefslogtreecommitdiff
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
parent9cbc861095375793a69858f91f3ac4e817f320f0 (diff)
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>
-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)