mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 08:44:21 +08:00
usb: dwc3: gadget: initialize transfer index from send_gadget_ep_cmd()
Instead of *always* calling dwc3_gadget_ep_get_transfer_index() after sending a Start Transfer command, we can call it once from dwc3_send_gadget_ep_cmd() itself. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
parent
4439661d64
commit
d7ca7e1896
@ -79,7 +79,6 @@ static int dwc3_ep0_start_trans(struct dwc3_ep *dep)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
dwc3_gadget_ep_get_transfer_index(dep);
|
||||
dwc->ep0_next_event = DWC3_EP0_COMPLETE;
|
||||
|
||||
return 0;
|
||||
|
@ -378,6 +378,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd,
|
||||
switch (DWC3_DEPCMD_CMD(cmd)) {
|
||||
case DWC3_DEPCMD_STARTTRANSFER:
|
||||
dep->flags |= DWC3_EP_TRANSFER_STARTED;
|
||||
dwc3_gadget_ep_get_transfer_index(dep);
|
||||
break;
|
||||
case DWC3_DEPCMD_ENDTRANSFER:
|
||||
dep->flags &= ~DWC3_EP_TRANSFER_STARTED;
|
||||
@ -682,8 +683,6 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, unsigned int action)
|
||||
ret = dwc3_send_gadget_ep_cmd(dep, cmd, ¶ms);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
dwc3_gadget_ep_get_transfer_index(dep);
|
||||
}
|
||||
|
||||
out:
|
||||
@ -1244,9 +1243,6 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (starting)
|
||||
dwc3_gadget_ep_get_transfer_index(dep);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user