Skip to content

Commit

Permalink
wm8350-regulator: fix wm8350_register_regulator error handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Liam Girdwood committed Jul 27, 2010
1 parent 979da89 commit e9a1c51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/wm8350-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e9a1c51

Please sign in to comment.