]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00278097-2 usb: chipidea: imx: Add usb_phy_shutdown at probe's error path
authorPeter Chen <peter.chen@freescale.com>
Wed, 4 Sep 2013 07:06:21 +0000 (15:06 +0800)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:55:26 +0000 (09:55 +0800)
If not, the PHY will be active even the controller is not in use.
We find this issue due to the PHY's clock refcount is not correct
due to -EPROBE_DEFER return after phy's init.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/chipidea/ci_hdrc_imx.c

index 66de2ca74cc9fd9e04667dd9ed662c35bfe0123e..76eabf1829822a08b8da41727b1c1e7dc6c1fa4a 100644 (file)
@@ -131,7 +131,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
                if (ret) {
                        dev_err(&pdev->dev, "usbmisc init failed, ret=%d\n",
                                        ret);
-                       goto err_clk;
+                       goto err_phy;
                }
        }
 
@@ -143,7 +143,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
                dev_err(&pdev->dev,
                        "Can't register ci_hdrc platform device, err=%d\n",
                        ret);
-               goto err_clk;
+               goto err_phy;
        }
 
        if (data->usbmisc_data) {
@@ -164,6 +164,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 
 disable_device:
        ci_hdrc_remove_device(data->ci_pdev);
+err_phy:
+       if (data->phy)
+               usb_phy_shutdown(data->phy);
 err_clk:
        clk_disable_unprepare(data->clk);
        return ret;