diff options
author | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-09-05 14:28:46 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-10-19 10:38:05 +0300 |
commit | ccb94ebf9e65ca722c98df3885c2e3dfe832260c (patch) | |
tree | f425e8ca73bcdb4b1bb8fe2c502e9d6cdfacf646 /drivers/usb/dwc3 | |
parent | f9c5d1dbda8ee8757a987a55d6cf21b4eb443548 (diff) | |
download | linux-ccb94ebf9e65ca722c98df3885c2e3dfe832260c.tar.bz2 |
usb: dwc3: gadget: check for lack of TRBs a bit earlier
This will let us call __dwc3_gadget_kick_transfer()
unconditionally. No functional changes, cleanup only.
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index f064f1549333..a943f6e00fe1 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1151,9 +1151,6 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep) BUILD_BUG_ON_NOT_POWER_OF_2(DWC3_TRB_NUM); - if (!dwc3_calc_trbs_left(dep)) - return; - /* * We can get in a situation where there's a request in the started list * but there weren't enough TRBs to fully kick it in the first time @@ -1202,6 +1199,9 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param) int ret; u32 cmd; + if (!dwc3_calc_trbs_left(dep)) + return 0; + starting = !(dep->flags & DWC3_EP_BUSY); dwc3_prepare_trbs(dep); |