From: Axel Lin Date: Mon, 26 Jul 2010 02:41:58 +0000 (+0800) Subject: wm8350-regulator: fix wm8350_register_regulator error handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e9a1c5129de1caf4526b8df5f200ff628b2ffab4;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Acked-by: Mark Brown Signed-off-by: Liam Girdwood --- 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; }