diff mbox

[v2,03/10] usb: dwc2/gadget: fix gadget unregistration in udc_stop() function

Message ID 1413801940-31086-4-git-send-email-m.szyprowski@samsung.com
State Accepted
Commit 32805c350bad16e7d4debe55820d2e79dca89fb6
Headers show

Commit Message

Marek Szyprowski Oct. 20, 2014, 10:45 a.m. UTC
udc_stop() should clear ->driver pointer unconditionally to let the UDC
framework to work correctly with both registering/unregistering gadgets
and enabling/disabling gadgets by writing to
/sys/class/udc/*hsotg/soft_connect interface.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/usb/dwc2/gadget.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Felipe Balbi Oct. 23, 2014, 3:01 p.m. UTC | #1
On Mon, Oct 20, 2014 at 12:45:33PM +0200, Marek Szyprowski wrote:
> udc_stop() should clear ->driver pointer unconditionally to let the UDC
> framework to work correctly with both registering/unregistering gadgets
> and enabling/disabling gadgets by writing to
> /sys/class/udc/*hsotg/soft_connect interface.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Also here. In fact, this is much more important :-)
Paul Zimmerman Oct. 23, 2014, 6:18 p.m. UTC | #2
> From: Felipe Balbi [mailto:balbi@ti.com]
> Sent: Thursday, October 23, 2014 8:02 AM
> 
> On Mon, Oct 20, 2014 at 12:45:33PM +0200, Marek Szyprowski wrote:
> > udc_stop() should clear ->driver pointer unconditionally to let the UDC
> > framework to work correctly with both registering/unregistering gadgets
> > and enabling/disabling gadgets by writing to
> > /sys/class/udc/*hsotg/soft_connect interface.
> >
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> 
> Also here. In fact, this is much more important :-)

Acked-by: Paul Zimmerman <paulz@synopsys.com>

Are there any more patches in this series that need immediate attention?
Otherwise I plan to finish reviewing the series on Friday or so.
Felipe Balbi Oct. 23, 2014, 6:56 p.m. UTC | #3
On Thu, Oct 23, 2014 at 06:18:51PM +0000, Paul Zimmerman wrote:
> > From: Felipe Balbi [mailto:balbi@ti.com]
> > Sent: Thursday, October 23, 2014 8:02 AM
> > 
> > On Mon, Oct 20, 2014 at 12:45:33PM +0200, Marek Szyprowski wrote:
> > > udc_stop() should clear ->driver pointer unconditionally to let the UDC
> > > framework to work correctly with both registering/unregistering gadgets
> > > and enabling/disabling gadgets by writing to
> > > /sys/class/udc/*hsotg/soft_connect interface.
> > >
> > > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > 
> > Also here. In fact, this is much more important :-)
> 
> Acked-by: Paul Zimmerman <paulz@synopsys.com>
> 
> Are there any more patches in this series that need immediate attention?
> Otherwise I plan to finish reviewing the series on Friday or so.

no, this is the most important one. Everything else can wait until
Friday, thanks.
diff mbox

Patch

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 8870e38c1d82..a4b4def23afd 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2940,9 +2940,7 @@  static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
 
 	spin_lock_irqsave(&hsotg->lock, flags);
 
-	if (!driver)
-		hsotg->driver = NULL;
-
+	hsotg->driver = NULL;
 	hsotg->gadget.speed = USB_SPEED_UNKNOWN;
 
 	spin_unlock_irqrestore(&hsotg->lock, flags);