summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2017-09-05 14:32:55 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-10-19 10:38:05 +0300
commit64e01080299784692ff291099cd8a5ee72e66d98 (patch)
treedde0773c0ad5e66a9ecca5b449775bb0bf30b640 /drivers/usb/dwc3/gadget.c
parentccb94ebf9e65ca722c98df3885c2e3dfe832260c (diff)
downloadlinux-64e01080299784692ff291099cd8a5ee72e66d98.tar.bz2
usb: dwc3: gadget: simplify __dwc3_gadget_ep_queue()
There is more possibility for sharing code if we just realise that now __dwc3_gadget_kic_transfer() knows to break out early if there are no TRBs left. 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.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index a943f6e00fe1..850fda013768 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1290,7 +1290,6 @@ static void dwc3_gadget_start_isoc(struct dwc3 *dwc,
static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
{
struct dwc3 *dwc = dep->dwc;
- int ret = 0;
if (!dep->endpoint.desc) {
dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
@@ -1337,24 +1336,14 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
}
if ((dep->flags & DWC3_EP_BUSY) &&
- !(dep->flags & DWC3_EP_MISSED_ISOC)) {
- WARN_ON_ONCE(!dep->resource_index);
- ret = __dwc3_gadget_kick_transfer(dep,
- dep->resource_index);
- }
-
- goto out;
- }
+ !(dep->flags & DWC3_EP_MISSED_ISOC))
+ goto out;
- if (!dwc3_calc_trbs_left(dep))
return 0;
+ }
- ret = __dwc3_gadget_kick_transfer(dep, 0);
out:
- if (ret == -EBUSY)
- ret = 0;
-
- return ret;
+ return __dwc3_gadget_kick_transfer(dep, 0);
}
static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,