Skip to contentSkip to conversation

wm8350-regulator: fix wm8350_register_regulator error handling

PATCH Applied Axel Lin 3 participants 3 messages Jul 26, 2010 – Jul 27, 2010

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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()

---
 drivers/regulator/wm8350-regulator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/wm8350-regulator.c +1 -1
index 723cd1f..0e6ed7d 100644
@@ -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;
 	}
 
Signature · 1 line
1.5.4.3
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Axel Lin

In the case of platform_device_add() fail, we should call platform_device_put() instead of platform_device_del()

Quoted 22 lines

---
drivers/regulator/wm8350-regulator.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/wm8350-regulator.c +1 -1
index 723cd1f..0e6ed7d 100644
@@ -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;
 	}
 
Signature · 1 line
1.5.4.3
#2 lore raw
Quoted 8 lines · Mark Brown
Quoted 4 lines · Axel Lin

In the case of platform_device_add() fail, we should call platform_device_put() instead of platform_device_del()

Applied.

Thanks

Liam

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk