aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/aat2870-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-09-03 02:19:00 -0400
committerMark Brown <broonie@linaro.org>2013-09-16 19:27:55 -0400
commitb1a613d505c53ad4f4af4cf228841a1784a50011 (patch)
tree8c0c04e49ca07f1c74ce4aeb8be60cf485f893bd /drivers/regulator/aat2870-regulator.c
parentbcb5fe44875b09756c5e81925de19f9ca5bb9117 (diff)
regulator: aat2870: Convert to devm_regulator_register
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Jinyoung Park <jinyoungp@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/aat2870-regulator.c')
-rw-r--r--drivers/regulator/aat2870-regulator.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/regulator/aat2870-regulator.c b/drivers/regulator/aat2870-regulator.c
index 881159dfcb5e..f70a9bfa5ff2 100644
--- a/drivers/regulator/aat2870-regulator.c
+++ b/drivers/regulator/aat2870-regulator.c
@@ -176,7 +176,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev)
176 config.driver_data = ri; 176 config.driver_data = ri;
177 config.init_data = dev_get_platdata(&pdev->dev); 177 config.init_data = dev_get_platdata(&pdev->dev);
178 178
179 rdev = regulator_register(&ri->desc, &config); 179 rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config);
180 if (IS_ERR(rdev)) { 180 if (IS_ERR(rdev)) {
181 dev_err(&pdev->dev, "Failed to register regulator %s\n", 181 dev_err(&pdev->dev, "Failed to register regulator %s\n",
182 ri->desc.name); 182 ri->desc.name);
@@ -187,21 +187,12 @@ static int aat2870_regulator_probe(struct platform_device *pdev)
187 return 0; 187 return 0;
188} 188}
189 189
190static int aat2870_regulator_remove(struct platform_device *pdev)
191{
192 struct regulator_dev *rdev = platform_get_drvdata(pdev);
193
194 regulator_unregister(rdev);
195 return 0;
196}
197
198static struct platform_driver aat2870_regulator_driver = { 190static struct platform_driver aat2870_regulator_driver = {
199 .driver = { 191 .driver = {
200 .name = "aat2870-regulator", 192 .name = "aat2870-regulator",
201 .owner = THIS_MODULE, 193 .owner = THIS_MODULE,
202 }, 194 },
203 .probe = aat2870_regulator_probe, 195 .probe = aat2870_regulator_probe,
204 .remove = aat2870_regulator_remove,
205}; 196};
206 197
207static int __init aat2870_regulator_init(void) 198static int __init aat2870_regulator_init(void)