diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-31 07:00:37 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-16 19:27:55 -0400 |
commit | e57e54693371fe1530f376c8a67c33d19bb2a0dc (patch) | |
tree | e4f7382cbc44c4463eacc600a48ab564b414f053 /drivers/regulator/wm8350-regulator.c | |
parent | fc7c60e390c9b99b28d078c27360cb6cd688cfd3 (diff) |
regulator: wm8350: Convert to devm_regulator_register()
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/wm8350-regulator.c')
-rw-r--r-- | drivers/regulator/wm8350-regulator.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 835b5f0f344e..a438e937cfa0 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c | |||
@@ -1206,7 +1206,8 @@ static int wm8350_regulator_probe(struct platform_device *pdev) | |||
1206 | config.regmap = wm8350->regmap; | 1206 | config.regmap = wm8350->regmap; |
1207 | 1207 | ||
1208 | /* register regulator */ | 1208 | /* register regulator */ |
1209 | rdev = regulator_register(&wm8350_reg[pdev->id], &config); | 1209 | rdev = devm_regulator_register(&pdev->dev, &wm8350_reg[pdev->id], |
1210 | &config); | ||
1210 | if (IS_ERR(rdev)) { | 1211 | if (IS_ERR(rdev)) { |
1211 | dev_err(&pdev->dev, "failed to register %s\n", | 1212 | dev_err(&pdev->dev, "failed to register %s\n", |
1212 | wm8350_reg[pdev->id].name); | 1213 | wm8350_reg[pdev->id].name); |
@@ -1217,7 +1218,6 @@ static int wm8350_regulator_probe(struct platform_device *pdev) | |||
1217 | ret = wm8350_register_irq(wm8350, wm8350_reg[pdev->id].irq, | 1218 | ret = wm8350_register_irq(wm8350, wm8350_reg[pdev->id].irq, |
1218 | pmic_uv_handler, 0, "UV", rdev); | 1219 | pmic_uv_handler, 0, "UV", rdev); |
1219 | if (ret < 0) { | 1220 | if (ret < 0) { |
1220 | regulator_unregister(rdev); | ||
1221 | dev_err(&pdev->dev, "failed to register regulator %s IRQ\n", | 1221 | dev_err(&pdev->dev, "failed to register regulator %s IRQ\n", |
1222 | wm8350_reg[pdev->id].name); | 1222 | wm8350_reg[pdev->id].name); |
1223 | return ret; | 1223 | return ret; |
@@ -1233,8 +1233,6 @@ static int wm8350_regulator_remove(struct platform_device *pdev) | |||
1233 | 1233 | ||
1234 | wm8350_free_irq(wm8350, wm8350_reg[pdev->id].irq, rdev); | 1234 | wm8350_free_irq(wm8350, wm8350_reg[pdev->id].irq, rdev); |
1235 | 1235 | ||
1236 | regulator_unregister(rdev); | ||
1237 | |||
1238 | return 0; | 1236 | return 0; |
1239 | } | 1237 | } |
1240 | 1238 | ||