diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-09-03 14:26:10 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-17 00:27:56 +0100 |
commit | 0d3288063b4e45335ea011b89d0850a0fd76096c (patch) | |
tree | 9add53b8c6e3ede902d6f0781989ae176dc40255 /drivers/regulator/da9055-regulator.c | |
parent | ea49a5ebbbfa982c893d4d6cf68feeb829f58324 (diff) | |
download | talos-obmc-linux-0d3288063b4e45335ea011b89d0850a0fd76096c.tar.gz talos-obmc-linux-0d3288063b4e45335ea011b89d0850a0fd76096c.zip |
regulator: da9055: 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/da9055-regulator.c')
-rw-r--r-- | drivers/regulator/da9055-regulator.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c index 77b53e5a231c..7f340206d329 100644 --- a/drivers/regulator/da9055-regulator.c +++ b/drivers/regulator/da9055-regulator.c @@ -564,13 +564,13 @@ static int da9055_regulator_probe(struct platform_device *pdev) if (ret < 0) return ret; - regulator->rdev = regulator_register(®ulator->info->reg_desc, - &config); + regulator->rdev = devm_regulator_register(&pdev->dev, + ®ulator->info->reg_desc, + &config); if (IS_ERR(regulator->rdev)) { dev_err(&pdev->dev, "Failed to register regulator %s\n", regulator->info->reg_desc.name); - ret = PTR_ERR(regulator->rdev); - return ret; + return PTR_ERR(regulator->rdev); } /* Only LDO 5 and 6 has got the over current interrupt */ @@ -588,7 +588,7 @@ static int da9055_regulator_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Failed to request Regulator IRQ %d: %d\n", irq, ret); - goto err_regulator; + return ret; } } } @@ -596,24 +596,10 @@ static int da9055_regulator_probe(struct platform_device *pdev) platform_set_drvdata(pdev, regulator); return 0; - -err_regulator: - regulator_unregister(regulator->rdev); - return ret; -} - -static int da9055_regulator_remove(struct platform_device *pdev) -{ - struct da9055_regulator *regulator = platform_get_drvdata(pdev); - - regulator_unregister(regulator->rdev); - - return 0; } static struct platform_driver da9055_regulator_driver = { .probe = da9055_regulator_probe, - .remove = da9055_regulator_remove, .driver = { .name = "da9055-regulator", .owner = THIS_MODULE, |