Commit f1c68e4d authored by Sachin Kamat's avatar Sachin Kamat Committed by Samuel Ortiz

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: default avatarSachin Kamat <sachin.kamat@linaro.org>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 71f39e5c
...@@ -467,7 +467,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) ...@@ -467,7 +467,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
goto err; goto err;
} }
ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies, ret = devm_regulator_bulk_get(wm8994->dev, wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
if (ret != 0) { if (ret != 0) {
dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret); 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,7 +478,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
wm8994->supplies); wm8994->supplies);
if (ret != 0) { if (ret != 0) {
dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret); dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret);
goto err_get; goto err;
} }
ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET); ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET);
...@@ -658,8 +658,6 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq) ...@@ -658,8 +658,6 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
err_enable: err_enable:
regulator_bulk_disable(wm8994->num_supplies, regulator_bulk_disable(wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
err_get:
regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
err: err:
mfd_remove_devices(wm8994->dev); mfd_remove_devices(wm8994->dev);
return ret; return ret;
...@@ -672,7 +670,6 @@ static void wm8994_device_exit(struct wm8994 *wm8994) ...@@ -672,7 +670,6 @@ static void wm8994_device_exit(struct wm8994 *wm8994)
wm8994_irq_exit(wm8994); wm8994_irq_exit(wm8994);
regulator_bulk_disable(wm8994->num_supplies, regulator_bulk_disable(wm8994->num_supplies,
wm8994->supplies); wm8994->supplies);
regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
} }
static const struct of_device_id wm8994_of_match[] = { static const struct of_device_id wm8994_of_match[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment