regulator: Remove NULL test before calling regulator_unregister()

It's safe to call regulator_unregister() with NULL, thus remove the NULL test
before regulator_unregister() calls.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
This commit is contained in:
Axel Lin
2013-04-27 13:58:08 +08:00
committed by Mark Brown
parent 1e4b545cdd
commit 020501f1a0
5 changed files with 7 additions and 14 deletions

View File

@@ -584,8 +584,7 @@ static int pmic_remove(struct spi_device *spi)
if (!hw)
return 0;
for (i = 0; i < N_REGULATORS; i++) {
if (hw->rdev[i])
regulator_unregister(hw->rdev[i]);
regulator_unregister(hw->rdev[i]);
hw->rdev[i] = NULL;
}
spi_set_drvdata(spi, NULL);