usb: gadget: s3c-hsotg: 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>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Sachin Kamat 2013-01-08 14:27:00 +05:30 committed by Felipe Balbi
parent 924d2532ab
commit cd76213eb5

View File

@ -3573,7 +3573,7 @@ static int s3c_hsotg_probe(struct platform_device *pdev)
for (i = 0; i < ARRAY_SIZE(hsotg->supplies); i++) for (i = 0; i < ARRAY_SIZE(hsotg->supplies); i++)
hsotg->supplies[i].supply = s3c_hsotg_supply_names[i]; hsotg->supplies[i].supply = s3c_hsotg_supply_names[i];
ret = regulator_bulk_get(dev, ARRAY_SIZE(hsotg->supplies), ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(hsotg->supplies),
hsotg->supplies); hsotg->supplies);
if (ret) { if (ret) {
dev_err(dev, "failed to request supplies: %d\n", ret); dev_err(dev, "failed to request supplies: %d\n", ret);
@ -3663,8 +3663,6 @@ err_ep_mem:
kfree(eps); kfree(eps);
err_supplies: err_supplies:
s3c_hsotg_phy_disable(hsotg); s3c_hsotg_phy_disable(hsotg);
regulator_bulk_free(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
err_clk: err_clk:
clk_disable_unprepare(hsotg->clk); clk_disable_unprepare(hsotg->clk);
@ -3689,7 +3687,6 @@ static int s3c_hsotg_remove(struct platform_device *pdev)
} }
s3c_hsotg_phy_disable(hsotg); s3c_hsotg_phy_disable(hsotg);
regulator_bulk_free(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
clk_disable_unprepare(hsotg->clk); clk_disable_unprepare(hsotg->clk);