summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2018-04-06 11:04:21 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-05-21 10:00:56 +0300
commitd80fe1b6e34d39ded5718f9433350c0d823c21d6 (patch)
tree83b23e8e2dfe609edc0cd87194c147d60de4b6b2 /drivers/usb/dwc3/gadget.c
parentb27972b508d113b8fcfb04a2520915111b431bb2 (diff)
downloadlinux-d80fe1b6e34d39ded5718f9433350c0d823c21d6.tar.gz
linux-d80fe1b6e34d39ded5718f9433350c0d823c21d6.tar.bz2
linux-d80fe1b6e34d39ded5718f9433350c0d823c21d6.zip
usb: dwc3: gadget: simplify short packet event
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 <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 7fa8b15021e8..752d615c959b 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2221,7 +2221,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);
@@ -2256,12 +2255,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) &&