diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-09-29 20:56:24 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-30 13:10:59 -0400 |
commit | 58765e24bec8940082068829a9d2c3a4431d60c0 (patch) | |
tree | 0d03a74a2e18de75cf7a1bbd7e0fe23cd7a33bb9 | |
parent | 0b7bb09054aebe66fd803c8f88015046b96cb47f (diff) |
regulator: max8925: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/regulator/max8925-regulator.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c index d80b5fa758ae..759510789e71 100644 --- a/drivers/regulator/max8925-regulator.c +++ b/drivers/regulator/max8925-regulator.c | |||
@@ -312,7 +312,7 @@ static int max8925_regulator_probe(struct platform_device *pdev) | |||
312 | if (pdata) | 312 | if (pdata) |
313 | config.init_data = pdata; | 313 | config.init_data = pdata; |
314 | 314 | ||
315 | rdev = regulator_register(&ri->desc, &config); | 315 | rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config); |
316 | if (IS_ERR(rdev)) { | 316 | if (IS_ERR(rdev)) { |
317 | dev_err(&pdev->dev, "failed to register regulator %s\n", | 317 | dev_err(&pdev->dev, "failed to register regulator %s\n", |
318 | ri->desc.name); | 318 | ri->desc.name); |
@@ -323,22 +323,12 @@ static int max8925_regulator_probe(struct platform_device *pdev) | |||
323 | return 0; | 323 | return 0; |
324 | } | 324 | } |
325 | 325 | ||
326 | static int max8925_regulator_remove(struct platform_device *pdev) | ||
327 | { | ||
328 | struct regulator_dev *rdev = platform_get_drvdata(pdev); | ||
329 | |||
330 | regulator_unregister(rdev); | ||
331 | |||
332 | return 0; | ||
333 | } | ||
334 | |||
335 | static struct platform_driver max8925_regulator_driver = { | 326 | static struct platform_driver max8925_regulator_driver = { |
336 | .driver = { | 327 | .driver = { |
337 | .name = "max8925-regulator", | 328 | .name = "max8925-regulator", |
338 | .owner = THIS_MODULE, | 329 | .owner = THIS_MODULE, |
339 | }, | 330 | }, |
340 | .probe = max8925_regulator_probe, | 331 | .probe = max8925_regulator_probe, |
341 | .remove = max8925_regulator_remove, | ||
342 | }; | 332 | }; |
343 | 333 | ||
344 | static int __init max8925_regulator_init(void) | 334 | static int __init max8925_regulator_init(void) |