We know that only OUT endpoints can trigger SHORT. We also know that
count MUST be > 0 whenever SHORT triggers.

Signed-off-by: Felipe Balbi <[email protected]>
---
 drivers/usb/dwc3/gadget.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index c43d1d4b7bb5..c3dd569786db 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2196,7 +2196,6 @@ static int dwc3_gadget_ep_reclaim_completed_trb(struct 
dwc3_ep *dep,
                const struct dwc3_event_depevt *event, int status, int chain)
 {
        unsigned int            count;
-       unsigned int            s_pkt = 0;
 
        dwc3_ep_inc_deq(dep);
 
@@ -2231,12 +2230,7 @@ static int dwc3_gadget_ep_reclaim_completed_trb(struct 
dwc3_ep *dep,
        if ((trb->ctrl & DWC3_TRB_CTRL_HWO) && status != -ESHUTDOWN)
                return 1;
 
-       if (!dep->direction) {
-               if (count && (event->status & DEPEVT_STATUS_SHORT))
-                       s_pkt = 1;
-       }
-
-       if (s_pkt && !chain)
+       if (event->status & DEPEVT_STATUS_SHORT && !chain)
                return 1;
 
        if ((event->status & DEPEVT_STATUS_IOC) &&
-- 
2.16.1

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

Reply via email to