This is the last check that can be done earlier. No functional
changes.

Signed-off-by: Felipe Balbi <felipe.ba...@linux.intel.com>
---
 drivers/usb/host/xhci.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 284dc6c10189..dba4c61f5cf6 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1305,6 +1305,12 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct 
urb *urb, gfp_t mem_flag
                return -ESHUTDOWN;
        }
 
+       if (!HCD_HW_ACCESSIBLE(hcd)) {
+               if (!in_interrupt())
+                       xhci_dbg(xhci, "urb submitted during PCI suspend\n");
+               return -ESHUTDOWN;
+       }
+
        slot_id = urb->dev->slot_id;
        ep_index = xhci_get_endpoint_index(&urb->ep->desc);
        ep_state = &xhci->devs[slot_id]->eps[ep_index].ep_state;
@@ -1321,12 +1327,6 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct 
urb *urb, gfp_t mem_flag
                }
        }
 
-       if (!HCD_HW_ACCESSIBLE(hcd)) {
-               if (!in_interrupt())
-                       xhci_dbg(xhci, "urb submitted during PCI suspend\n");
-               return -ESHUTDOWN;
-       }
-
        if (usb_endpoint_xfer_isoc(&urb->ep->desc))
                num_tds = urb->number_of_packets;
        else if (usb_endpoint_is_bulk_out(&urb->ep->desc) &&
-- 
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to