diff options
author | Paul Zimmerman <Paul.Zimmerman@synopsys.com> | 2013-07-13 14:53:50 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-23 14:54:48 -0700 |
commit | 399fdf9e57457444bbb5ab33eefa1f8723e9ea05 (patch) | |
tree | 29dc57a066a01ffdc959aa6a2080ef2f4e9665e1 /drivers/staging/dwc2 | |
parent | c9e1c907ff520bdc01170a8d6461d262094ed6f8 (diff) |
staging: dwc2: optimize dwc2_hc_handle_tt_clear() a bit
Make dwc2_hc_handle_tt_clear() return early if the device is
hi-speed.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dwc2')
-rw-r--r-- | drivers/staging/dwc2/hcd_intr.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/staging/dwc2/hcd_intr.c b/drivers/staging/dwc2/hcd_intr.c index 22836f5f7ff6..093a75c3d0db 100644 --- a/drivers/staging/dwc2/hcd_intr.c +++ b/drivers/staging/dwc2/hcd_intr.c @@ -89,15 +89,20 @@ static void dwc2_hc_handle_tt_clear(struct dwc2_hsotg *hsotg, { struct urb *usb_urb; - if (!chan->qh || !qtd->urb) + if (!chan->qh) + return; + + if (chan->qh->dev_speed == USB_SPEED_HIGH) + return; + + if (!qtd->urb) return; usb_urb = qtd->urb->priv; - if (!usb_urb || !usb_urb->dev) + if (!usb_urb || !usb_urb->dev || !usb_urb->dev->tt) return; - if (chan->qh->dev_speed != USB_SPEED_HIGH && - qtd->urb->status != -EPIPE && qtd->urb->status != -EREMOTEIO) { + if (qtd->urb->status != -EPIPE && qtd->urb->status != -EREMOTEIO) { chan->qh->tt_buffer_dirty = 1; if (usb_hub_clear_tt_buffer(usb_urb)) /* Clear failed; let's hope things work anyway */ |