Skip to content

Commit

Permalink
usb: dwc2: gadget: fix gadget unregistration in udc_stop() function
Browse files Browse the repository at this point in the history
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.

Acked-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
mszyprow authored and Felipe Balbi committed Oct 23, 2014
1 parent fd4850c commit 32805c3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/usb/dwc2/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -2937,9 +2937,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);
Expand Down

0 comments on commit 32805c3

Please sign in to comment.