diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-31 07:01:12 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-16 19:27:55 -0400 |
commit | 9e2bfbbdf203c954a306a5e402a84c24622c55b0 (patch) | |
tree | b16394aae142c164162fd2a71ca60dd767be572d /drivers/regulator/wm8994-regulator.c | |
parent | eb8b3c8360408b78ca99492f8c1fec080c75dd71 (diff) |
regulator: wm8994: Convert to devm_regulator_register
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/wm8994-regulator.c')
-rw-r--r-- | drivers/regulator/wm8994-regulator.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index 5ee2a208457c..71c5911f2e71 100644 --- a/drivers/regulator/wm8994-regulator.c +++ b/drivers/regulator/wm8994-regulator.c | |||
@@ -165,7 +165,9 @@ static int wm8994_ldo_probe(struct platform_device *pdev) | |||
165 | ldo->init_data = *pdata->ldo[id].init_data; | 165 | ldo->init_data = *pdata->ldo[id].init_data; |
166 | } | 166 | } |
167 | 167 | ||
168 | ldo->regulator = regulator_register(&wm8994_ldo_desc[id], &config); | 168 | ldo->regulator = devm_regulator_register(&pdev->dev, |
169 | &wm8994_ldo_desc[id], | ||
170 | &config); | ||
169 | if (IS_ERR(ldo->regulator)) { | 171 | if (IS_ERR(ldo->regulator)) { |
170 | ret = PTR_ERR(ldo->regulator); | 172 | ret = PTR_ERR(ldo->regulator); |
171 | dev_err(wm8994->dev, "Failed to register LDO%d: %d\n", | 173 | dev_err(wm8994->dev, "Failed to register LDO%d: %d\n", |
@@ -181,18 +183,8 @@ err: | |||
181 | return ret; | 183 | return ret; |
182 | } | 184 | } |
183 | 185 | ||
184 | static int wm8994_ldo_remove(struct platform_device *pdev) | ||
185 | { | ||
186 | struct wm8994_ldo *ldo = platform_get_drvdata(pdev); | ||
187 | |||
188 | regulator_unregister(ldo->regulator); | ||
189 | |||
190 | return 0; | ||
191 | } | ||
192 | |||
193 | static struct platform_driver wm8994_ldo_driver = { | 186 | static struct platform_driver wm8994_ldo_driver = { |
194 | .probe = wm8994_ldo_probe, | 187 | .probe = wm8994_ldo_probe, |
195 | .remove = wm8994_ldo_remove, | ||
196 | .driver = { | 188 | .driver = { |
197 | .name = "wm8994-ldo", | 189 | .name = "wm8994-ldo", |
198 | .owner = THIS_MODULE, | 190 | .owner = THIS_MODULE, |