Skip to content

Commit e9a1c51

Browse files
AxelLinLiam Girdwood
authored andcommitted
wm8350-regulator: fix wm8350_register_regulator error handling
In the case of platform_device_add() fail, we should call platform_device_put() instead of platform_device_del() Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
1 parent 979da89 commit e9a1c51

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/regulator/wm8350-regulator.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
14951495
if (ret != 0) {
14961496
dev_err(wm8350->dev, "Failed to register regulator %d: %d\n",
14971497
reg, ret);
1498-
platform_device_del(pdev);
1498+
platform_device_put(pdev);
14991499
wm8350->pmic.pdev[reg] = NULL;
15001500
}
15011501

0 commit comments

Comments
 (0)