forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
979da89a9c
commit
e9a1c5129d
|
@ -1495,7 +1495,7 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
|
|||
if (ret != 0) {
|
||||
dev_err(wm8350->dev, "Failed to register regulator %d: %d\n",
|
||||
reg, ret);
|
||||
platform_device_del(pdev);
|
||||
platform_device_put(pdev);
|
||||
wm8350->pmic.pdev[reg] = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user