That function is used for both Bulk and Interrupt transfer types, let's make it clear on the function name and provide one extra helper for queueing bulk transfers. Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> --- drivers/usb/host/xhci-ring.c | 23 +++++++++++++++++++++-- drivers/usb/host/xhci.c | 6 ------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 91a1a824673d..e9c6053f90c5 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -3064,6 +3064,9 @@ static void check_interval(struct xhci_hcd *xhci, struct urb *urb, } } +static int xhci_queue_bulk_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, + struct urb *urb, int slot_id, unsigned int ep_index); + /* * xHCI uses normal TRBs for both bulk and interrupt. When the interrupt * endpoint is to be serviced, the xHC will consume (at most) one TD. A TD @@ -3078,7 +3081,23 @@ int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, ep_ctx = xhci_get_ep_ctx(xhci, xhci->devs[slot_id]->out_ctx, ep_index); check_interval(xhci, urb, ep_ctx); - return xhci_queue_bulk_tx(xhci, mem_flags, urb, slot_id, ep_index); + return xhci_queue_bulk_intr_tx(xhci, mem_flags, urb, slot_id, ep_index); +} + +int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, + struct urb *urb, int slot_id, unsigned int ep_index) +{ + unsigned int ep_state; + + ep_state = xhci->devs[slot_id]->eps[ep_index].ep_state; + + if (ep_state & (EP_GETTING_STREAMS | EP_GETTING_NO_STREAMS)) { + xhci_warn(xhci, "WARN: Can't enqueue URB, ep in streams transition state %x\n", + ep_state); + return -EINVAL; + } + + return xhci_queue_bulk_intr_tx(xhci, mem_flags, urb, slot_id, ep_index); } /* @@ -3189,7 +3208,7 @@ static int xhci_align_td(struct xhci_hcd *xhci, struct urb *urb, u32 enqd_len, } /* This is very similar to what ehci-q.c qtd_fill() does */ -int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, +static int xhci_queue_bulk_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, int slot_id, unsigned int ep_index) { struct xhci_ring *ring; diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 9b27798ecce5..65c454b94165 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1353,12 +1353,6 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag ret = -ESHUTDOWN; goto free_priv; } - if (*ep_state & (EP_GETTING_STREAMS | EP_GETTING_NO_STREAMS)) { - xhci_warn(xhci, "WARN: Can't enqueue URB, ep in streams transition state %x\n", - *ep_state); - ret = -EINVAL; - goto free_priv; - } if (*ep_state & EP_SOFT_CLEAR_TOGGLE) { xhci_warn(xhci, "Can't enqueue URB while manually clearing toggle\n"); ret = -EINVAL; -- 2.16.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html