wm8350-regulator: fix wm8350_register_regulator error handling
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()
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/wm8350-regulator.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/wm8350-regulator.c +1 -1
@@ -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
Quoted 4 lines · Axel Lin
In the case of
platform_device_add()fail, we should callplatform_device_put()instead ofplatform_device_del()Signed-off-by Axel Lin <[email protected]>
Acked-by Mark Brown <[email protected]>
Quoted 22 lines
---
drivers/regulator/wm8350-regulator.c| 2 +-1 files changed, 1 insertions(+), 1 deletions(-)drivers/regulator/wm8350-regulator.c +1
-1@@ -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
Liam Girdwood
AppliedQuoted 8 lines · Mark Brown
Quoted 4 lines · Axel Lin
In the case of
platform_device_add()fail, we should callplatform_device_put()instead ofplatform_device_del()Signed-off-by Axel Lin <[email protected]>Acked-by Mark Brown <[email protected]>
Applied.
Thanks
Liam
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk