diff options
author | Felipe Balbi <balbi@ti.com> | 2014-09-24 10:50:14 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-10-20 15:58:48 -0500 |
commit | 95aa4e8d658778f787e2ce205d3018443d027477 (patch) | |
tree | ce5b16094ff79a56f449ddef52ed4959011e5064 | |
parent | 5ad02fb813a9d8f39af1ccb1f2166cc80fd76f09 (diff) |
usb: dwc3: gadget: hold the lock through set_wedge()'s life
Instead of releasing the lock and calling locked
versions of our set_halt() methods, let's hold
the lock all the way through and call unlocked
versions of those functions.
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index fd92f6305091..b98295efd912 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1257,15 +1257,18 @@ static int dwc3_gadget_ep_set_wedge(struct usb_ep *ep) struct dwc3_ep *dep = to_dwc3_ep(ep); struct dwc3 *dwc = dep->dwc; unsigned long flags; + int ret; spin_lock_irqsave(&dwc->lock, flags); dep->flags |= DWC3_EP_WEDGE; - spin_unlock_irqrestore(&dwc->lock, flags); if (dep->number == 0 || dep->number == 1) - return dwc3_gadget_ep0_set_halt(ep, 1); + ret = __dwc3_gadget_ep0_set_halt(ep, 1); else - return dwc3_gadget_ep_set_halt(ep, 1); + ret = __dwc3_gadget_ep_set_halt(dep, 1); + spin_unlock_irqrestore(&dwc->lock, flags); + + return ret; } /* -------------------------------------------------------------------------- */ |