Patchwork [069/106] usb: dwc3: gadget: don't prevent gadget from being probed if we fail

login
register
mail settings
Submitter Luis Henriques
Date July 30, 2013, 9:31 a.m.
Message ID <1375176725-5825-70-git-send-email-luis.henriques@canonical.com>
Download mbox | patch
Permalink /patch/263326/
State New
Headers show

Comments

Luis Henriques - July 30, 2013, 9:31 a.m.
3.5.7.18 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Felipe Balbi <balbi@ti.com>

commit cdcedd6981194e511cc206887db661d016069d68 upstream.

In case we fail our ->udc_start() callback, we
should be ready to accept another modprobe following
the failed one.

We had forgotten to clear dwc->gadget_driver back
to NULL and, because of that, we were preventing
gadget driver modprobe from being retried.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/usb/dwc3/gadget.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 3530c2b..5a7755b 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1445,6 +1445,7 @@  err1:
 	__dwc3_gadget_ep_disable(dwc->eps[0]);
 
 err0:
+	dwc->gadget_driver = NULL;
 	spin_unlock_irqrestore(&dwc->lock, flags);
 
 	return ret;