diff options
author | Felipe Balbi <balbi@ti.com> | 2014-09-24 10:48:26 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-10-20 15:58:48 -0500 |
commit | 5ad02fb813a9d8f39af1ccb1f2166cc80fd76f09 (patch) | |
tree | 73da4c8017ffd3be4734401395574e515a1ebfa9 /drivers/usb/dwc3/gadget.c | |
parent | 33fb691b3ea4aca6cab4867e09ea2726c784660a (diff) | |
download | linux-stable-5ad02fb813a9d8f39af1ccb1f2166cc80fd76f09.tar.gz linux-stable-5ad02fb813a9d8f39af1ccb1f2166cc80fd76f09.tar.bz2 linux-stable-5ad02fb813a9d8f39af1ccb1f2166cc80fd76f09.zip |
usb: dwc3: gadget: move isoc endpoint check to unlocked set_halt
__dwc3_gadget_ep_set_halt() is the function which
handles the actual halt feature. In order to cope
with some extra cleanup comming as a follow-up patch
let's move the isochronous endpoint check there too.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 3818b26bfc05..fd92f6305091 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1208,6 +1208,11 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value) struct dwc3 *dwc = dep->dwc; int ret; + if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { + dev_err(dwc->dev, "%s is of Isochronous type\n", dep->name); + return -EINVAL; + } + memset(¶ms, 0x00, sizeof(params)); if (value) { @@ -1241,15 +1246,7 @@ static int dwc3_gadget_ep_set_halt(struct usb_ep *ep, int value) int ret; spin_lock_irqsave(&dwc->lock, flags); - - if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { - dev_err(dwc->dev, "%s is of Isochronous type\n", dep->name); - ret = -EINVAL; - goto out; - } - ret = __dwc3_gadget_ep_set_halt(dep, value); -out: spin_unlock_irqrestore(&dwc->lock, flags); return ret; |