diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2014-10-20 06:45:33 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-10-23 14:57:08 -0400 |
commit | 32805c350bad16e7d4debe55820d2e79dca89fb6 (patch) | |
tree | f40f963f90f47c6b4a7c29a9afc404221b8b68f6 /drivers/usb | |
parent | fd4850cfd4e4060ec85a9db590b5d0e23eec68f5 (diff) |
usb: dwc2: gadget: fix gadget unregistration in udc_stop() function
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc2/gadget.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 7f25527b10a7..5e548f75686c 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
@@ -2937,9 +2937,7 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget, | |||
2937 | 2937 | ||
2938 | spin_lock_irqsave(&hsotg->lock, flags); | 2938 | spin_lock_irqsave(&hsotg->lock, flags); |
2939 | 2939 | ||
2940 | if (!driver) | 2940 | hsotg->driver = NULL; |
2941 | hsotg->driver = NULL; | ||
2942 | |||
2943 | hsotg->gadget.speed = USB_SPEED_UNKNOWN; | 2941 | hsotg->gadget.speed = USB_SPEED_UNKNOWN; |
2944 | 2942 | ||
2945 | spin_unlock_irqrestore(&hsotg->lock, flags); | 2943 | spin_unlock_irqrestore(&hsotg->lock, flags); |