diff options
author | Felipe Balbi <balbi@ti.com> | 2012-10-19 09:55:16 +0200 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2012-11-12 20:45:34 +0100 |
commit | 77b847677e7cb633627a9ddaa7efbc3fa8586427 (patch) | |
tree | ef429fad8f64d69f81e028fa32ace84705dd5997 /drivers/usb/host/xhci.c | |
parent | usb: host: xhci: Stricter conditional for Z1 system models for Compliance Mod... (diff) | |
download | linux-77b847677e7cb633627a9ddaa7efbc3fa8586427.tar.xz linux-77b847677e7cb633627a9ddaa7efbc3fa8586427.zip |
usb: host: xhci: move HC_STATE_SUSPENDED check to xhci_suspend()
that check will have to be done by all users
of xhci_suspend() so it sounds a lot better to
move the check to xhci_suspend() in order to
avoid code duplication.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r-- | drivers/usb/host/xhci.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 09987d57934c..5c72c431bab1 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -880,6 +880,10 @@ int xhci_suspend(struct xhci_hcd *xhci) struct usb_hcd *hcd = xhci_to_hcd(xhci); u32 command; + if (hcd->state != HC_STATE_SUSPENDED || + xhci->shared_hcd->state != HC_STATE_SUSPENDED) + return -EINVAL; + spin_lock_irq(&xhci->lock); clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); clear_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags); |