Browse Source

regulator: palmas: Drop regulator_unregister while using devm_regulator_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>
Axel Lin 12 years ago
parent
commit
cb2e45e316
1 changed files with 1 additions and 3 deletions
  1. 1 3
      drivers/regulator/palmas-regulator.c

+ 1 - 3
drivers/regulator/palmas-regulator.c

@@ -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;
-				}
 			}
 		}
 	}