Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Axel Lin and committed by
Liam Girdwood
e9a1c512 979da89a

+1 -1
+1 -1
drivers/regulator/wm8350-regulator.c
··· 1495 1495 if (ret != 0) { 1496 1496 dev_err(wm8350->dev, "Failed to register regulator %d: %d\n", 1497 1497 reg, ret); 1498 - platform_device_del(pdev); 1498 + platform_device_put(pdev); 1499 1499 wm8350->pmic.pdev[reg] = NULL; 1500 1500 } 1501 1501