Skip to content

Commit

Permalink
regulator: palmas: Drop regulator_unregister while using devm_regulat…
Browse files Browse the repository at this point in the history
…or_register

Commmit af40a94aba "regulator: palmas: Use devm_regulator_register" missed
removing a regulator_unregister() call if palmas_extreg_init falis. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Sep 16, 2013
1 parent cab87f0 commit cb2e45e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/regulator/palmas-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,10 +1037,8 @@ static int palmas_regulators_probe(struct platform_device *pdev)
else
ret = palmas_extreg_init(palmas,
id, reg_init);
if (ret) {
regulator_unregister(pmic->rdev[id]);
if (ret)
return ret;
}
}
}
}
Expand Down

0 comments on commit cb2e45e

Please sign in to comment.