Skip to content

Commit e1347bd

Browse files
Uwe Kleine-Königpavelmachek
authored andcommitted
leds: is31fl32xx: Improve error reporting in .remove()
Returning an error value in an i2c remove callback results in a generic 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. So instead of triggering the generic i2c error message, emit a more helpful message if a problem occurs and return 0 to suppress the generic message. 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 818d03b commit e1347bd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/leds/leds-is31fl32xx.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,14 @@ static int is31fl32xx_probe(struct i2c_client *client,
460460
static int is31fl32xx_remove(struct i2c_client *client)
461461
{
462462
struct is31fl32xx_priv *priv = i2c_get_clientdata(client);
463+
int ret;
463464

464-
return is31fl32xx_reset_regs(priv);
465+
ret = is31fl32xx_reset_regs(priv);
466+
if (ret)
467+
dev_err(&client->dev, "Failed to reset registers on removal (%pe)\n",
468+
ERR_PTR(ret));
469+
470+
return 0;
465471
}
466472

467473
/*

0 commit comments

Comments
 (0)