diff options
author | Lukasz Majewski <l.majewski@samsung.com> | 2012-06-14 04:02:25 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-06-15 07:37:50 -0400 |
commit | 2b19a52cc8a31ede990323d46a7faeeeba76bb8f (patch) | |
tree | 18ab359eb637516306b7a23e360285f27ca5bc0d /drivers/usb/gadget | |
parent | 22258f4906aa87e0c0debcad22cb292453e2ebfb (diff) |
usb: hsotg: samsung: Protect the udc_stop routine with spinlock
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index b10791282f15..ee1fe2b8b07f 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -2988,6 +2988,7 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget, | |||
2988 | struct usb_gadget_driver *driver) | 2988 | struct usb_gadget_driver *driver) |
2989 | { | 2989 | { |
2990 | struct s3c_hsotg *hsotg = to_hsotg(gadget); | 2990 | struct s3c_hsotg *hsotg = to_hsotg(gadget); |
2991 | unsigned long flags = 0; | ||
2991 | int ep; | 2992 | int ep; |
2992 | 2993 | ||
2993 | if (!hsotg) | 2994 | if (!hsotg) |
@@ -3000,6 +3001,8 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget, | |||
3000 | for (ep = 0; ep < hsotg->num_of_eps; ep++) | 3001 | for (ep = 0; ep < hsotg->num_of_eps; ep++) |
3001 | s3c_hsotg_ep_disable(&hsotg->eps[ep].ep); | 3002 | s3c_hsotg_ep_disable(&hsotg->eps[ep].ep); |
3002 | 3003 | ||
3004 | spin_lock_irqsave(&hsotg->lock, flags); | ||
3005 | |||
3003 | s3c_hsotg_phy_disable(hsotg); | 3006 | s3c_hsotg_phy_disable(hsotg); |
3004 | regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); | 3007 | regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); |
3005 | 3008 | ||
@@ -3007,6 +3010,8 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget, | |||
3007 | hsotg->gadget.speed = USB_SPEED_UNKNOWN; | 3010 | hsotg->gadget.speed = USB_SPEED_UNKNOWN; |
3008 | hsotg->gadget.dev.driver = NULL; | 3011 | hsotg->gadget.dev.driver = NULL; |
3009 | 3012 | ||
3013 | spin_unlock_irqrestore(&hsotg->lock, flags); | ||
3014 | |||
3010 | dev_info(hsotg->dev, "unregistered gadget driver '%s'\n", | 3015 | dev_info(hsotg->dev, "unregistered gadget driver '%s'\n", |
3011 | driver->driver.name); | 3016 | driver->driver.name); |
3012 | 3017 | ||