@@ -761,6 +761,8 @@ static void xhci_stop(struct usb_hcd *hcd)
mutex_unlock(&xhci->mutex);
}
+extern struct device_type pci_dev_type;
+
/*
* Shutdown HC (not bus-specific)
*
@@ -791,8 +793,12 @@ static void xhci_shutdown(struct usb_hcd *hcd)
readl(&xhci->op_regs->status));
/* Yet another workaround for spurious wakeups at shutdown with HSW */
- if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
- pci_set_power_state(to_pci_dev(hcd->self.sysdev), PCI_D3hot);
+ if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) {
+ struct device *dev = hcd->self.sysdev;
+
+ if (dev->type == &pci_dev_type)
+ pci_set_power_state(to_pci_dev(dev), PCI_D3hot);
+ }
}
#ifdef CONFIG_PM
xhci driver cannot call pci_set_power_state() on non-pci xhci host controllers. Signed-off-by: Henry Lin <henryl@nvidia.com> --- drivers/usb/host/xhci.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)