Skip to content

Commit 654933a

Browse files
committed
leds: flash: Remove redundant initialization of variable ret
Adjust initialization not to trigger Coverity warnings. Reported-by: Colin Ian King <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent 9cbc861 commit 654933a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/leds/led-class-flash.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,12 @@ static ssize_t flash_strobe_store(struct device *dev,
9292
struct led_classdev *led_cdev = dev_get_drvdata(dev);
9393
struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev);
9494
unsigned long state;
95-
ssize_t ret = -EINVAL;
95+
ssize_t ret = -EBUSY;
9696

9797
mutex_lock(&led_cdev->led_access);
9898

99-
if (led_sysfs_is_disabled(led_cdev)) {
100-
ret = -EBUSY;
99+
if (led_sysfs_is_disabled(led_cdev))
101100
goto unlock;
102-
}
103101

104102
ret = kstrtoul(buf, 10, &state);
105103
if (ret)

0 commit comments

Comments
 (0)