aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-02-19 03:34:11 -0500
committerMark Brown <broonie@linaro.org>2014-02-19 07:18:54 -0500
commit413be59e2f33382305876b17f218666d03cf3aac (patch)
tree533183d9c3ff073a8cb7a64b2fac431b6b6bf0c2
parentc46b5295ac3db8ac20e8970ce668b8e784833eee (diff)
regulator: tps65218: Remove unnecessary regulator_unregister call
Current code uses devm_regulator_register() so the we don't need to explicitly call regulator_unregister() in .remove. And then we don't need to save rdev pointer to tps->rdev[id]. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/regulator/tps65218-regulator.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
index d1c78313aa28..1fb1db551ec9 100644
--- a/drivers/regulator/tps65218-regulator.c
+++ b/drivers/regulator/tps65218-regulator.c
@@ -267,23 +267,6 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
267 return PTR_ERR(rdev); 267 return PTR_ERR(rdev);
268 } 268 }
269 269
270 /* Save regulator */
271 tps->rdev[id] = rdev;
272
273 return 0;
274}
275
276static int tps65218_regulator_remove(struct platform_device *pdev)
277{
278 struct tps65218 *tps = platform_get_drvdata(pdev);
279 const struct of_device_id *match;
280 const struct tps_info *template;
281
282 match = of_match_device(tps65218_of_match, &pdev->dev);
283 template = match->data;
284 regulator_unregister(tps->rdev[template->id]);
285 platform_set_drvdata(pdev, NULL);
286
287 return 0; 270 return 0;
288} 271}
289 272
@@ -294,7 +277,6 @@ static struct platform_driver tps65218_regulator_driver = {
294 .of_match_table = of_match_ptr(tps65218_of_match), 277 .of_match_table = of_match_ptr(tps65218_of_match),
295 }, 278 },
296 .probe = tps65218_regulator_probe, 279 .probe = tps65218_regulator_probe,
297 .remove = tps65218_regulator_remove,
298}; 280};
299 281
300module_platform_driver(tps65218_regulator_driver); 282module_platform_driver(tps65218_regulator_driver);