regulator: ab8500: Unregister ab8500-ext regulators in probe() failure path

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Axel Lin 2013-04-11 12:05:43 +08:00 коммит произвёл Mark Brown
Родитель 3480c0cab6
Коммит 42e8c811ba
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -3172,9 +3172,12 @@ 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;
}