aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2021-12-28 21:43:22 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2022-01-03 18:33:29 +0100
commitbe2c0d5418b1f44b01154a71e4501de139d0a7c9 (patch)
tree74725bb88f801cec4a8dee5f3a10f89ac4d8485f /drivers/power
parentpower: reset: mt6397: Check for null res pointer (diff)
downloadlinux-dev-be2c0d5418b1f44b01154a71e4501de139d0a7c9.tar.xz
linux-dev-be2c0d5418b1f44b01154a71e4501de139d0a7c9.zip
power: supply: ab8500: Fix the error handling path of ab8500_charger_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: 6252c706cdb0 ("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>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/ab8500_charger.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index db7457064a17..ce074c018dcb 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -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 */
@@ -3710,6 +3712,8 @@ out_charger_notifier:
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;
}