Skip to content

Commit

Permalink
leds: lm3692x: Return 0 from remove callback
Browse files Browse the repository at this point in the history
The only difference between returning zero or a non-zero value is that
for the non-zero case the i2c will print a generic error message
("remove failed (-ESOMETHING), will be ignored").

In this case however the driver itself already emitted a more helpful
error message, so the additional error message isn't helpful at all.

The long-term goal is to make the i2c remove callback return void, making
all implementations return 0 is preparatory work for this change.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
  • Loading branch information
Uwe Kleine-König authored and Pavel Machek committed Feb 12, 2022
1 parent 77d62fc commit cf642fa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/leds/leds-lm3692x.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,8 @@ static int lm3692x_probe(struct i2c_client *client,
static int lm3692x_remove(struct i2c_client *client)
{
struct lm3692x_led *led = i2c_get_clientdata(client);
int ret;

ret = lm3692x_leds_disable(led);
if (ret)
return ret;
lm3692x_leds_disable(led);
mutex_destroy(&led->lock);

return 0;
Expand Down

0 comments on commit cf642fa

Please sign in to comment.