summary refs log tree commit diff
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-07-26 10:41:58 +0800
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-07-27 11:29:27 +0100
commite9a1c5129de1caf4526b8df5f200ff628b2ffab4 (patch)
treeac137716e50cb3216a71536f37c7248fd9dc95f8
parent979da89a9c230381ca55ea0764428a5d42a01e7f (diff)
downloadlinux-e9a1c5129de1caf4526b8df5f200ff628b2ffab4.tar.gz
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>
-rw-r--r--drivers/regulator/wm8350-regulator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index 723cd1fb4867..0e6ed7db9364 100644
--- a/drivers/regulator/wm8350-regulator.c
+++ b/drivers/regulator/wm8350-regulator.c
@@ -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;
 	}