If DWC3 works as peripheral only mode, XHCI HCD will
not be created and added, so we should only get XHCI
HCD in host mode.
Change-Id: Iefb02431d6a973050986963bbabe0a943283f4b3
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
container_of(work, struct dwc3_rockchip, otg_work);
struct dwc3 *dwc = rockchip->dwc;
struct extcon_dev *edev = rockchip->edev;
- struct usb_hcd *hcd = dev_get_drvdata(&dwc->xhci->dev);
+ struct usb_hcd *hcd;
unsigned long flags;
int ret;
u32 reg;
*/
usleep_range(10000, 11000);
+ hcd = dev_get_drvdata(&dwc->xhci->dev);
+
if (hcd->state == HC_STATE_HALT) {
usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
usb_add_hcd(hcd->shared_hcd, hcd->irq, IRQF_SHARED);