aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/da9052-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-09-03 02:24:46 -0400
committerMark Brown <broonie@linaro.org>2013-09-16 19:27:56 -0400
commitea49a5ebbbfa982c893d4d6cf68feeb829f58324 (patch)
treeac6c82ff9b55ec641c0d2d2a5f7b5bf51152f9bf /drivers/regulator/da9052-regulator.c
parent4e8d79355da117b4be7ea6f870eabc7f18740f2c (diff)
regulator: da9052: Convert to devm_regulator_register
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/da9052-regulator.c')
-rw-r--r--drivers/regulator/da9052-regulator.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c
index 1e4d483f6163..c427e42472e8 100644
--- a/drivers/regulator/da9052-regulator.c
+++ b/drivers/regulator/da9052-regulator.c
@@ -389,8 +389,9 @@ static int da9052_regulator_probe(struct platform_device *pdev)
389#endif 389#endif
390 } 390 }
391 391
392 regulator->rdev = regulator_register(&regulator->info->reg_desc, 392 regulator->rdev = devm_regulator_register(&pdev->dev,
393 &config); 393 &regulator->info->reg_desc,
394 &config);
394 if (IS_ERR(regulator->rdev)) { 395 if (IS_ERR(regulator->rdev)) {
395 dev_err(&pdev->dev, "failed to register regulator %s\n", 396 dev_err(&pdev->dev, "failed to register regulator %s\n",
396 regulator->info->reg_desc.name); 397 regulator->info->reg_desc.name);
@@ -402,17 +403,8 @@ static int da9052_regulator_probe(struct platform_device *pdev)
402 return 0; 403 return 0;
403} 404}
404 405
405static int da9052_regulator_remove(struct platform_device *pdev)
406{
407 struct da9052_regulator *regulator = platform_get_drvdata(pdev);
408
409 regulator_unregister(regulator->rdev);
410 return 0;
411}
412
413static struct platform_driver da9052_regulator_driver = { 406static struct platform_driver da9052_regulator_driver = {
414 .probe = da9052_regulator_probe, 407 .probe = da9052_regulator_probe,
415 .remove = da9052_regulator_remove,
416 .driver = { 408 .driver = {
417 .name = "da9052-regulator", 409 .name = "da9052-regulator",
418 .owner = THIS_MODULE, 410 .owner = THIS_MODULE,