summaryrefslogtreecommitdiff
path: root/drivers/regulator/twl-regulator.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-09-30 09:59:04 +0900
committerMark Brown <broonie@linaro.org>2013-09-30 18:11:03 +0100
commit00ce070e51f96ee4c942b44d63b7a15f5b777fd6 (patch)
tree0f0935eea49e42fdf9c3fe6279caa89d0c14c01a /drivers/regulator/twl-regulator.c
parent6a2b5a931f31c91cc2e261d99af7b3d881a41d86 (diff)
regulator: twl: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/twl-regulator.c')
-rw-r--r--drivers/regulator/twl-regulator.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 78aae4cbb004..8ebd785485c7 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -1188,7 +1188,7 @@ static int twlreg_probe(struct platform_device *pdev)
config.driver_data = info;
config.of_node = pdev->dev.of_node;
- rdev = regulator_register(&info->desc, &config);
+ rdev = devm_regulator_register(&pdev->dev, &info->desc, &config);
if (IS_ERR(rdev)) {
dev_err(&pdev->dev, "can't register %s, %ld\n",
info->desc.name, PTR_ERR(rdev));
@@ -1217,7 +1217,6 @@ static int twlreg_remove(struct platform_device *pdev)
struct regulator_dev *rdev = platform_get_drvdata(pdev);
struct twlreg_info *info = rdev->reg_data;
- regulator_unregister(rdev);
kfree(info);
return 0;
}