usb: dwc3: rockchip-inno: rework the disconnect workflow

This patch doesn't fix any issue but make the code more concise.

Change-Id: I56d9d0e5f13579d2087edc41ca83bdb00e1ebb3f
Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
William Wu
2019-11-04 09:39:46 +08:00
parent bad1a35496
commit cdff9a65d9

View File

@@ -258,16 +258,12 @@ static void u3phy_disconnect_det_work(struct work_struct *work)
struct dwc3_rockchip *rockchip =
container_of(work, struct dwc3_rockchip, u3_work);
struct usb_hcd *hcd = dev_get_drvdata(&rockchip->dwc->xhci->dev);
struct usb_hcd *shared_hcd = hcd->shared_hcd;
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
u32 count = 0;
mutex_lock(&rockchip->lock);
if (hcd->state != HC_STATE_HALT) {
usb_remove_hcd(shared_hcd);
usb_remove_hcd(hcd);
}
if (hcd->state != HC_STATE_HALT)
dwc3_host_exit(rockchip->dwc);
if (rockchip->phy)
usb_phy_shutdown(rockchip->phy);
@@ -281,11 +277,8 @@ static void u3phy_disconnect_det_work(struct work_struct *work)
usleep_range(1000, 1100);
}
if (hcd->state == HC_STATE_HALT) {
xhci->shared_hcd = shared_hcd;
usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
usb_add_hcd(shared_hcd, hcd->irq, IRQF_SHARED);
}
if (hcd->state == HC_STATE_HALT)
dwc3_host_init(rockchip->dwc);
if (rockchip->phy)
usb_phy_init(rockchip->phy);