diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-31 06:57:00 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-16 19:27:54 -0400 |
commit | b6b7709cf95c6f5db074f2d725ddf29b0977589f (patch) | |
tree | d77ab54f43d65361048567d418669d558a18d982 /drivers/regulator/arizona-micsupp.c | |
parent | 14ffa8882bbd991497f2f87ce80382e5a1e6eb8f (diff) |
regulator: arizona-micsupp: Convert to devm_regulator_register()
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/arizona-micsupp.c')
-rw-r--r-- | drivers/regulator/arizona-micsupp.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/regulator/arizona-micsupp.c b/drivers/regulator/arizona-micsupp.c index e87536bf0bed..724706a97dc4 100644 --- a/drivers/regulator/arizona-micsupp.c +++ b/drivers/regulator/arizona-micsupp.c | |||
@@ -225,7 +225,9 @@ static int arizona_micsupp_probe(struct platform_device *pdev) | |||
225 | regmap_update_bits(arizona->regmap, ARIZONA_MIC_CHARGE_PUMP_1, | 225 | regmap_update_bits(arizona->regmap, ARIZONA_MIC_CHARGE_PUMP_1, |
226 | ARIZONA_CPMIC_BYPASS, 0); | 226 | ARIZONA_CPMIC_BYPASS, 0); |
227 | 227 | ||
228 | micsupp->regulator = regulator_register(&arizona_micsupp, &config); | 228 | micsupp->regulator = devm_regulator_register(&pdev->dev, |
229 | &arizona_micsupp, | ||
230 | &config); | ||
229 | if (IS_ERR(micsupp->regulator)) { | 231 | if (IS_ERR(micsupp->regulator)) { |
230 | ret = PTR_ERR(micsupp->regulator); | 232 | ret = PTR_ERR(micsupp->regulator); |
231 | dev_err(arizona->dev, "Failed to register mic supply: %d\n", | 233 | dev_err(arizona->dev, "Failed to register mic supply: %d\n", |
@@ -238,18 +240,8 @@ static int arizona_micsupp_probe(struct platform_device *pdev) | |||
238 | return 0; | 240 | return 0; |
239 | } | 241 | } |
240 | 242 | ||
241 | static int arizona_micsupp_remove(struct platform_device *pdev) | ||
242 | { | ||
243 | struct arizona_micsupp *micsupp = platform_get_drvdata(pdev); | ||
244 | |||
245 | regulator_unregister(micsupp->regulator); | ||
246 | |||
247 | return 0; | ||
248 | } | ||
249 | |||
250 | static struct platform_driver arizona_micsupp_driver = { | 243 | static struct platform_driver arizona_micsupp_driver = { |
251 | .probe = arizona_micsupp_probe, | 244 | .probe = arizona_micsupp_probe, |
252 | .remove = arizona_micsupp_remove, | ||
253 | .driver = { | 245 | .driver = { |
254 | .name = "arizona-micsupp", | 246 | .name = "arizona-micsupp", |
255 | .owner = THIS_MODULE, | 247 | .owner = THIS_MODULE, |