Skip to content

Commit 4950486

Browse files
Uwe Kleine-Königbroonie
authored andcommitted
regulator: da9121: Emit only one error message in .remove()
When an i2c remove callback fails, the i2c core emits a generic error message and still removes the device. Apart from the message there the return value isn't further used. So don't return an error code after having already emitted a driver specific warning about the problem to prevent two messages about the same issue. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent fa55b7d commit 4950486

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/regulator/da9121-regulator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,15 +1065,15 @@ static int da9121_i2c_remove(struct i2c_client *i2c)
10651065
{
10661066
struct da9121 *chip = i2c_get_clientdata(i2c);
10671067
const int mask_all[4] = { 0xFF, 0xFF, 0xFF, 0xFF };
1068-
int ret = 0;
1068+
int ret;
10691069

10701070
free_irq(chip->chip_irq, chip);
10711071
cancel_delayed_work_sync(&chip->work);
10721072

10731073
ret = regmap_bulk_write(chip->regmap, DA9121_REG_SYS_MASK_0, mask_all, 4);
10741074
if (ret != 0)
10751075
dev_err(chip->dev, "Failed to set IRQ masks: %d\n", ret);
1076-
return ret;
1076+
return 0;
10771077
}
10781078

10791079
static const struct i2c_device_id da9121_i2c_id[] = {

0 commit comments

Comments
 (0)