Commit ccb94ebf authored by Felipe Balbi's avatar Felipe Balbi

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: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent f9c5d1db
...@@ -1151,9 +1151,6 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep) ...@@ -1151,9 +1151,6 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep)
BUILD_BUG_ON_NOT_POWER_OF_2(DWC3_TRB_NUM); 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 * 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 * 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) ...@@ -1202,6 +1199,9 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param)
int ret; int ret;
u32 cmd; u32 cmd;
if (!dwc3_calc_trbs_left(dep))
return 0;
starting = !(dep->flags & DWC3_EP_BUSY); starting = !(dep->flags & DWC3_EP_BUSY);
dwc3_prepare_trbs(dep); dwc3_prepare_trbs(dep);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment