diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/composite.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 5d11c291f1ad..40f1da77a006 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c | |||
@@ -149,16 +149,17 @@ done: | |||
149 | int usb_function_deactivate(struct usb_function *function) | 149 | int usb_function_deactivate(struct usb_function *function) |
150 | { | 150 | { |
151 | struct usb_composite_dev *cdev = function->config->cdev; | 151 | struct usb_composite_dev *cdev = function->config->cdev; |
152 | unsigned long flags; | ||
152 | int status = 0; | 153 | int status = 0; |
153 | 154 | ||
154 | spin_lock(&cdev->lock); | 155 | spin_lock_irqsave(&cdev->lock, flags); |
155 | 156 | ||
156 | if (cdev->deactivations == 0) | 157 | if (cdev->deactivations == 0) |
157 | status = usb_gadget_disconnect(cdev->gadget); | 158 | status = usb_gadget_disconnect(cdev->gadget); |
158 | if (status == 0) | 159 | if (status == 0) |
159 | cdev->deactivations++; | 160 | cdev->deactivations++; |
160 | 161 | ||
161 | spin_unlock(&cdev->lock); | 162 | spin_unlock_irqrestore(&cdev->lock, flags); |
162 | return status; | 163 | return status; |
163 | } | 164 | } |
164 | 165 | ||