usb: dwc3: gadget: hold gadget IRQ in dwc->irq_gadget

by holding gadget's IRQ number in dwc->irq_gadget,
it'll be simpler to free_irq() and disable the IRQ
in case an IRQ fires while we are runtime suspended.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
Felipe Balbi
2016-05-16 14:17:06 +03:00
parent 51f5d49ad6
commit 3f308d17d7
2 changed files with 4 additions and 3 deletions

View File

@@ -1751,6 +1751,7 @@ static int dwc3_gadget_start(struct usb_gadget *g,
irq, ret);
goto err0;
}
dwc->irq_gadget = irq;
spin_lock_irqsave(&dwc->lock, flags);
if (dwc->gadget_driver) {
@@ -1787,15 +1788,13 @@ static int dwc3_gadget_stop(struct usb_gadget *g)
{
struct dwc3 *dwc = gadget_to_dwc(g);
unsigned long flags;
int irq;
spin_lock_irqsave(&dwc->lock, flags);
__dwc3_gadget_stop(dwc);
dwc->gadget_driver = NULL;
spin_unlock_irqrestore(&dwc->lock, flags);
irq = platform_get_irq(to_platform_device(dwc->dev), 0);
free_irq(irq, dwc->ev_buf);
free_irq(dwc->irq_gadget, dwc->ev_buf);
return 0;
}