usb: dwc2: gadget: fix error path in dwc2_gadget_init
authorMian Yousaf Kaukab <yousaf.kaukab@intel.com>
Fri, 9 Jan 2015 12:38:45 +0000 (13:38 +0100)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Jan 2015 21:32:49 +0000 (15:32 -0600)
In the error path, s3c_hsotg_phy_disable should be called after a
call to s3c_hsotg_phy_enable is made.

Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc2/gadget.c

index 35d346fcd900ddcc2b6e6dd9b8c0bc9caf0e5869..a4d2c26225970d5e43ac28d3d3b828f12ff28219 100644 (file)
@@ -3476,7 +3476,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
 
        if (ret) {
                dev_err(dev, "failed to enable supplies: %d\n", ret);
-               goto err_supplies;
+               goto err_clk;
        }
 
        /* usb phy enable */
@@ -3510,7 +3510,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
                regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies),
                                       hsotg->supplies);
                dev_err(dev, "cannot claim IRQ for gadget\n");
-               goto err_clk;
+               goto err_supplies;
        }
 
        /* hsotg->num_of_eps holds number of EPs other than ep0 */