diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-09-03 06:22:00 (GMT) |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-16 23:27:56 (GMT) |
commit | 27447c934a9e6ea7753f61211ef06327915ed0d2 (patch) | |
tree | cdfd0b27c434bdec567f806143bd54ab5ec8b5cd /drivers/regulator/as3711-regulator.c | |
parent | 9b2cdac712448ca182dabeffd36bd532c53f3935 (diff) | |
download | linux-27447c934a9e6ea7753f61211ef06327915ed0d2.tar.xz |
regulator: as3711: 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/as3711-regulator.c')
-rw-r--r-- | drivers/regulator/as3711-regulator.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/regulator/as3711-regulator.c b/drivers/regulator/as3711-regulator.c index 8406cd7..fb27e6c 100644 --- a/drivers/regulator/as3711-regulator.c +++ b/drivers/regulator/as3711-regulator.c @@ -273,33 +273,16 @@ static int as3711_regulator_probe(struct platform_device *pdev) config.regmap = as3711->regmap; config.of_node = of_node[id]; - rdev = regulator_register(&ri->desc, &config); + rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config); if (IS_ERR(rdev)) { dev_err(&pdev->dev, "Failed to register regulator %s\n", ri->desc.name); - ret = PTR_ERR(rdev); - goto eregreg; + return PTR_ERR(rdev); } reg->rdev = rdev; } platform_set_drvdata(pdev, regs); return 0; - -eregreg: - while (--id >= 0) - regulator_unregister(regs[id].rdev); - - return ret; -} - -static int as3711_regulator_remove(struct platform_device *pdev) -{ - struct as3711_regulator *regs = platform_get_drvdata(pdev); - int id; - - for (id = 0; id < AS3711_REGULATOR_NUM; ++id) - regulator_unregister(regs[id].rdev); - return 0; } static struct platform_driver as3711_regulator_driver = { @@ -308,7 +291,6 @@ static struct platform_driver as3711_regulator_driver = { .owner = THIS_MODULE, }, .probe = as3711_regulator_probe, - .remove = as3711_regulator_remove, }; static int __init as3711_regulator_init(void) |