Skip to content

Commit

Permalink
power: supply: ab8500: Fix the error handling path of ab8500_charger_…
Browse files Browse the repository at this point in the history
…probe()

Since the commit below, ab8500_bm_of_remove() needs to be called after a
successful ab8500_bm_of_probe() call.
This commit has only updated the remove function.

Fix the error handling path of the probe the same way.

Fixes: 6252c70 ("power: supply: ab8500: Standardize operating temperature")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
  • Loading branch information
Christophe JAILLET authored and Sebastian Reichel committed Jan 3, 2022
1 parent 1c1348b commit be2c0d5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/power/supply/ab8500_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -3665,11 +3665,13 @@ static int ab8500_charger_probe(struct platform_device *pdev)
}
if (!match) {
dev_err(dev, "no matching components\n");
return -ENODEV;
ret = -ENODEV;
goto remove_ab8500_bm;
}
if (IS_ERR(match)) {
dev_err(dev, "could not create component match\n");
return PTR_ERR(match);
ret = PTR_ERR(match);
goto remove_ab8500_bm;
}

/* Notifier for external charger enabling */
Expand Down Expand Up @@ -3710,6 +3712,8 @@ static int ab8500_charger_probe(struct platform_device *pdev)
if (!di->ac_chg.enabled)
blocking_notifier_chain_unregister(
&charger_notifier_list, &charger_nb);
remove_ab8500_bm:
ab8500_bm_of_remove(di->usb_chg.psy, di->bm);
return ret;
}

Expand Down

0 comments on commit be2c0d5

Please sign in to comment.