Skip to content

Commit

Permalink
usb: gadget: s3c-hsudc: Use devm_regulator_bulk_get
Browse files Browse the repository at this point in the history
devm_regulator_bulk_get is device managed and makes exit code
simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Sachin Kamat authored and Felipe Balbi committed Jan 10, 2013
1 parent d2aec37 commit 924d253
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/gadget/s3c-hsudc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
for (i = 0; i < ARRAY_SIZE(hsudc->supplies); i++)
hsudc->supplies[i].supply = s3c_hsudc_supply_names[i];

ret = regulator_bulk_get(dev, ARRAY_SIZE(hsudc->supplies),
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(hsudc->supplies),
hsudc->supplies);
if (ret != 0) {
dev_err(dev, "failed to request supplies: %d\n", ret);
Expand Down Expand Up @@ -1367,7 +1367,6 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
if (!IS_ERR_OR_NULL(hsudc->transceiver))
usb_put_phy(hsudc->transceiver);

regulator_bulk_free(ARRAY_SIZE(hsudc->supplies), hsudc->supplies);
err_supplies:
return ret;
}
Expand Down

0 comments on commit 924d253

Please sign in to comment.