aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2018-04-11 12:58:46 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-05-21 10:01:01 +0300
commitd7ca7e1896b27eaca936ff8ff3abdd2492b55a34 (patch)
tree06fda06464f6e5f9e9876887b116a7d03977cc04 /drivers/usb/dwc3/gadget.c
parentusb: dwc3: gadget: assign resource_index inside get_transfer_index() (diff)
downloadlinux-dev-d7ca7e1896b27eaca936ff8ff3abdd2492b55a34.tar.xz
linux-dev-d7ca7e1896b27eaca936ff8ff3abdd2492b55a34.zip
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>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 9e4db9cdb95e..cca692e0bfd8 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -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, &params);
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;
}