summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/da9121-regulator.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2021-11-16 12:09:51 +0100
committerMark Brown <broonie@kernel.org>2021-11-16 15:30:01 +0100
commit4950486cd86f450baa847bfc13557244d834526c (patch)
tree45415c4a8eaeb09b7ef6470b9c637a707d1459ea /drivers/regulator/da9121-regulator.c
parentLinux 5.16-rc1 (diff)
downloadlinux-4950486cd86f450baa847bfc13557244d834526c.tar.xz
linux-4950486cd86f450baa847bfc13557244d834526c.zip
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 <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20211116110951.1213566-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/da9121-regulator.c')
-rw-r--r--drivers/regulator/da9121-regulator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c
index e66925090258..a5a83b772a85 100644
--- a/drivers/regulator/da9121-regulator.c
+++ b/drivers/regulator/da9121-regulator.c
@@ -1065,7 +1065,7 @@ static int da9121_i2c_remove(struct i2c_client *i2c)
{
struct da9121 *chip = i2c_get_clientdata(i2c);
const int mask_all[4] = { 0xFF, 0xFF, 0xFF, 0xFF };
- int ret = 0;
+ int ret;
free_irq(chip->chip_irq, chip);
cancel_delayed_work_sync(&chip->work);
@@ -1073,7 +1073,7 @@ static int da9121_i2c_remove(struct i2c_client *i2c)
ret = regmap_bulk_write(chip->regmap, DA9121_REG_SYS_MASK_0, mask_all, 4);
if (ret != 0)
dev_err(chip->dev, "Failed to set IRQ masks: %d\n", ret);
- return ret;
+ return 0;
}
static const struct i2c_device_id da9121_i2c_id[] = {