usb: gadget: s3c-hsudc: Use devm_regulator_bulk_get
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 7 Jan 2013 04:31:53 +0000 (10:01 +0530)
committerFelipe Balbi <balbi@ti.com>
Thu, 10 Jan 2013 10:41:37 +0000 (12:41 +0200)
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>
drivers/usb/gadget/s3c-hsudc.c

index 52379b11f0807d61b5371ae6e2a3cf8d72434e35..d2b8791bba28974d1b7d9deee7f9fe40a97cd283 100644 (file)
@@ -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);
@@ -1367,7 +1367,6 @@ err_res:
        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;
 }