diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-01-08 03:31:22 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-02-13 18:22:46 -0500 |
commit | f1c68e4dd455eeaf30647a52595a7daf62fc5492 (patch) | |
tree | b8cadd806b26f9f4f20ef2fcfa291f6dbb147fe3 /drivers/mfd | |
parent | 71f39e5c087418fb63a57f74478c3e32899592cd (diff) |
mfd: wm8994: Use devm_regulator_bulk_get API
devm_regulator_bulk_get is device managed and saves some cleanup
and exit code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/wm8994-core.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index 57c488d42d3e..803e93fae56a 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c | |||
@@ -467,7 +467,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) | |||
467 | goto err; | 467 | goto err; |
468 | } | 468 | } |
469 | 469 | ||
470 | ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies, | 470 | ret = devm_regulator_bulk_get(wm8994->dev, wm8994->num_supplies, |
471 | wm8994->supplies); | 471 | wm8994->supplies); |
472 | if (ret != 0) { | 472 | if (ret != 0) { |
473 | dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret); | 473 | dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret); |
@@ -478,7 +478,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) | |||
478 | wm8994->supplies); | 478 | wm8994->supplies); |
479 | if (ret != 0) { | 479 | if (ret != 0) { |
480 | dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret); | 480 | dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret); |
481 | goto err_get; | 481 | goto err; |
482 | } | 482 | } |
483 | 483 | ||
484 | ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET); | 484 | ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET); |
@@ -658,8 +658,6 @@ err_irq: | |||
658 | err_enable: | 658 | err_enable: |
659 | regulator_bulk_disable(wm8994->num_supplies, | 659 | regulator_bulk_disable(wm8994->num_supplies, |
660 | wm8994->supplies); | 660 | wm8994->supplies); |
661 | err_get: | ||
662 | regulator_bulk_free(wm8994->num_supplies, wm8994->supplies); | ||
663 | err: | 661 | err: |
664 | mfd_remove_devices(wm8994->dev); | 662 | mfd_remove_devices(wm8994->dev); |
665 | return ret; | 663 | return ret; |
@@ -672,7 +670,6 @@ static void wm8994_device_exit(struct wm8994 *wm8994) | |||
672 | wm8994_irq_exit(wm8994); | 670 | wm8994_irq_exit(wm8994); |
673 | regulator_bulk_disable(wm8994->num_supplies, | 671 | regulator_bulk_disable(wm8994->num_supplies, |
674 | wm8994->supplies); | 672 | wm8994->supplies); |
675 | regulator_bulk_free(wm8994->num_supplies, wm8994->supplies); | ||
676 | } | 673 | } |
677 | 674 | ||
678 | static const struct of_device_id wm8994_of_match[] = { | 675 | static const struct of_device_id wm8994_of_match[] = { |