diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-09-29 20:56:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-30 13:11:00 -0400 |
commit | 15dc006af830d85417c97b60a40b5a0b991ee32e (patch) | |
tree | 39873892fb933e95db997949d103659cce2469ea | |
parent | 58765e24bec8940082068829a9d2c3a4431d60c0 (diff) |
regulator: pcap: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/regulator/pcap-regulator.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/regulator/pcap-regulator.c b/drivers/regulator/pcap-regulator.c index b49eaeedea84..3727b7d0e9ac 100644 --- a/drivers/regulator/pcap-regulator.c +++ b/drivers/regulator/pcap-regulator.c | |||
@@ -246,7 +246,8 @@ static int pcap_regulator_probe(struct platform_device *pdev) | |||
246 | config.init_data = dev_get_platdata(&pdev->dev); | 246 | config.init_data = dev_get_platdata(&pdev->dev); |
247 | config.driver_data = pcap; | 247 | config.driver_data = pcap; |
248 | 248 | ||
249 | rdev = regulator_register(&pcap_regulators[pdev->id], &config); | 249 | rdev = devm_regulator_register(&pdev->dev, &pcap_regulators[pdev->id], |
250 | &config); | ||
250 | if (IS_ERR(rdev)) | 251 | if (IS_ERR(rdev)) |
251 | return PTR_ERR(rdev); | 252 | return PTR_ERR(rdev); |
252 | 253 | ||
@@ -255,22 +256,12 @@ static int pcap_regulator_probe(struct platform_device *pdev) | |||
255 | return 0; | 256 | return 0; |
256 | } | 257 | } |
257 | 258 | ||
258 | static int pcap_regulator_remove(struct platform_device *pdev) | ||
259 | { | ||
260 | struct regulator_dev *rdev = platform_get_drvdata(pdev); | ||
261 | |||
262 | regulator_unregister(rdev); | ||
263 | |||
264 | return 0; | ||
265 | } | ||
266 | |||
267 | static struct platform_driver pcap_regulator_driver = { | 259 | static struct platform_driver pcap_regulator_driver = { |
268 | .driver = { | 260 | .driver = { |
269 | .name = "pcap-regulator", | 261 | .name = "pcap-regulator", |
270 | .owner = THIS_MODULE, | 262 | .owner = THIS_MODULE, |
271 | }, | 263 | }, |
272 | .probe = pcap_regulator_probe, | 264 | .probe = pcap_regulator_probe, |
273 | .remove = pcap_regulator_remove, | ||
274 | }; | 265 | }; |
275 | 266 | ||
276 | static int __init pcap_regulator_init(void) | 267 | static int __init pcap_regulator_init(void) |