Skip to content

Commit

Permalink
power: supply: max77650: Make max77650_charger_disable() return void
Browse files Browse the repository at this point in the history
The return value of max77650_charger_disable() is ignored by all but one
caller. That one caller propagates the error code in the platform driver's
remove function. The only effect of that is that the driver core emits
a generic error message (but still removes the device). As
max77650_charger_disable() already emits an error message, this can better
be changed to return zero.

This is a preparation for making struct platform_driver::remove return
void, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
  • Loading branch information
Uwe Kleine-König authored and Sebastian Reichel committed Feb 13, 2023
1 parent eedb923 commit a915dfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/power/supply/max77650-charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static int max77650_charger_enable(struct max77650_charger_data *chg)
return rv;
}

static int max77650_charger_disable(struct max77650_charger_data *chg)
static void max77650_charger_disable(struct max77650_charger_data *chg)
{
int rv;

Expand All @@ -151,8 +151,6 @@ static int max77650_charger_disable(struct max77650_charger_data *chg)
MAX77650_CHARGER_DISABLED);
if (rv)
dev_err(chg->dev, "unable to disable the charger: %d\n", rv);

return rv;
}

static irqreturn_t max77650_charger_check_status(int irq, void *data)
Expand Down Expand Up @@ -351,7 +349,9 @@ static int max77650_charger_remove(struct platform_device *pdev)
{
struct max77650_charger_data *chg = platform_get_drvdata(pdev);

return max77650_charger_disable(chg);
max77650_charger_disable(chg);

return 0;
}

static const struct of_device_id max77650_charger_of_match[] = {
Expand Down

0 comments on commit a915dfd

Please sign in to comment.