From 42e8c811bab682121cb57d58e9a37d8cb38e51ca Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 11 Apr 2013 12:05:43 +0800 Subject: [PATCH] regulator: ab8500: Unregister ab8500-ext regulators in probe() failure path Signed-off-by: Axel Lin Acked-by: Bengt Jonsson Signed-off-by: Mark Brown --- drivers/regulator/ab8500.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index c200f8bb61db..ea182d3c23e6 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -3172,8 +3172,11 @@ static int ab8500_regulator_probe(struct platform_device *pdev) for (i = 0; i < abx500_regulator.info_size; i++) { err = ab8500_regulator_register(pdev, &pdata->regulator[i], i, NULL); - if (err < 0) + if (err < 0) { + if (!is_ab8505(ab8500)) + ab8500_ext_regulator_exit(pdev); return err; + } } return 0; -- 2.39.5