Skip to content

Commit 73bce57

Browse files
Uwe Kleine-Königpavelmachek
authored andcommitted
leds: lp50xx: Remove duplicated error reporting in .remove()
Returning an error value from an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As stk3310_set_state() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, don't pass the error value up the stack. Instead continue to clean up and return 0. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent 1d6a1b5 commit 73bce57

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/leds/leds-lp50xx.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,10 +569,8 @@ static int lp50xx_remove(struct i2c_client *client)
569569
int ret;
570570

571571
ret = lp50xx_enable_disable(led, 0);
572-
if (ret) {
572+
if (ret)
573573
dev_err(led->dev, "Failed to disable chip\n");
574-
return ret;
575-
}
576574

577575
if (led->regulator) {
578576
ret = regulator_disable(led->regulator);

0 commit comments

Comments
 (0)