summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/legacy/inode.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2017-06-30 06:26:31 (GMT)
committerAlex Shi <alex.shi@linaro.org>2017-06-30 06:26:31 (GMT)
commit78278fb152735c686cb13e1ae3bcee78fc2cd154 (patch)
treeed3f669fbb4422bf3dfaa6b20ea992c04c1eac01 /drivers/usb/gadget/legacy/inode.c
parent084eedbddaa526f53b20291ee7176be269620301 (diff)
parent92905e331aea278665c4b27fbb13c4547a8bcbb0 (diff)
downloadlinux-78278fb152735c686cb13e1ae3bcee78fc2cd154.tar.xz
Merge tag 'v4.9.35' into linux-linaro-lsk-v4.9
This is the 4.9.35 stable release
Diffstat (limited to 'drivers/usb/gadget/legacy/inode.c')
-rw-r--r--drivers/usb/gadget/legacy/inode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 1468d8f..f959c42 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -1183,8 +1183,10 @@ dev_release (struct inode *inode, struct file *fd)
/* closing ep0 === shutdown all */
- if (dev->gadget_registered)
+ if (dev->gadget_registered) {
usb_gadget_unregister_driver (&gadgetfs_driver);
+ dev->gadget_registered = false;
+ }
/* at this point "good" hardware has disconnected the
* device from USB; the host won't see it any more.
@@ -1677,9 +1679,10 @@ static void
gadgetfs_suspend (struct usb_gadget *gadget)
{
struct dev_data *dev = get_gadget_data (gadget);
+ unsigned long flags;
INFO (dev, "suspended from state %d\n", dev->state);
- spin_lock (&dev->lock);
+ spin_lock_irqsave(&dev->lock, flags);
switch (dev->state) {
case STATE_DEV_SETUP: // VERY odd... host died??
case STATE_DEV_CONNECTED:
@@ -1690,7 +1693,7 @@ gadgetfs_suspend (struct usb_gadget *gadget)
default:
break;
}
- spin_unlock (&dev->lock);
+ spin_unlock_irqrestore(&dev->lock, flags);
}
static struct usb_gadget_driver gadgetfs_driver = {