diff options
author | Amit Pundir <amit.pundir@linaro.org> | 2016-02-08 11:47:13 +0530 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2016-02-08 11:47:13 +0530 |
commit | a884540f5a58461512475fa88d547160e48b55e2 (patch) | |
tree | bc6703cbe855c70fb927a6df8b850f4f56e8b344 | |
parent | a4291fedcbb40d43c095b54033a156949a71f12b (diff) | |
download | hikey-linaro-a884540f5a58461512475fa88d547160e48b55e2.tar.gz |
Revert "usb: gadget: composite: Fix corruption when changing configuration"
This reverts commit 4b749ddcb21c8cffd9989d200ef4a1bef7877e09.
We do not need this fix with Android ConfigFS gadgets.
Change-Id: I7dffb884a49ecb2f5d619150edfa3e51808ef8cc
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r-- | drivers/usb/gadget/composite.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index e2c4286359ab..5beec3b449cc 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -845,7 +845,7 @@ done: } EXPORT_SYMBOL_GPL(usb_add_config); -static void unbind_config(struct usb_composite_dev *cdev, +static void remove_config(struct usb_composite_dev *cdev, struct usb_configuration *config) { while (!list_empty(&config->functions)) { @@ -860,6 +860,7 @@ static void unbind_config(struct usb_composite_dev *cdev, /* may free memory for "f" */ } } + list_del(&config->list); if (config->unbind) { DBG(cdev, "unbind config '%s'/%p\n", config->label, config); config->unbind(config); @@ -886,11 +887,9 @@ void usb_remove_config(struct usb_composite_dev *cdev, if (cdev->config == config) reset_config(cdev); - list_del(&config->list); - spin_unlock_irqrestore(&cdev->lock, flags); - unbind_config(cdev, config); + remove_config(cdev, config); } /*-------------------------------------------------------------------------*/ @@ -1879,8 +1878,7 @@ static void __composite_unbind(struct usb_gadget *gadget, bool unbind_driver) struct usb_configuration *c; c = list_first_entry(&cdev->configs, struct usb_configuration, list); - list_del(&c->list); - unbind_config(cdev, c); + remove_config(cdev, c); } if (cdev->driver->unbind && unbind_driver) cdev->driver->unbind(cdev); |