Skip to content

Commit

Permalink
usb: dwc3: core: add phy cleanup for probe error handling
Browse files Browse the repository at this point in the history
commit 03c1fd6 upstream.

Add the phy cleanup if dwc3 mode init fail, which is the missing part of
de-init for dwc3 core init.

Fixes: c499ff7 ("usb: dwc3: core: re-factor init and exit paths")
Cc: <stable@vger.kernel.org>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Junlisuzhou authored and gregkh committed Nov 5, 2020
1 parent d548d39 commit 19544d5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/usb/dwc3/core.c
Expand Up @@ -1564,6 +1564,17 @@ static int dwc3_probe(struct platform_device *pdev)

err5:
dwc3_event_buffers_cleanup(dwc);

usb_phy_shutdown(dwc->usb2_phy);
usb_phy_shutdown(dwc->usb3_phy);
phy_exit(dwc->usb2_generic_phy);
phy_exit(dwc->usb3_generic_phy);

usb_phy_set_suspend(dwc->usb2_phy, 1);
usb_phy_set_suspend(dwc->usb3_phy, 1);
phy_power_off(dwc->usb2_generic_phy);
phy_power_off(dwc->usb3_generic_phy);

dwc3_ulpi_exit(dwc);

err4:
Expand Down

0 comments on commit 19544d5

Please sign in to comment.