Skip to content

Commit

Permalink
usb: chipidea: imx: Add usb_phy_shutdown at probe's error path
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Chen authored and Greg Kroah-Hartman committed Sep 26, 2013
1 parent 222bed9 commit 3a254fe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/usb/chipidea/ci_hdrc_imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 3a254fe

Please sign in to comment.