summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-20 10:16:07 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-20 10:16:07 +0800
commit571949a40a9c00fdaa3d0256cf43c9e0c25ff2d1 (patch)
tree7edcc302961329a7a3c4d2942f6c2300b4765345 /drivers/usb/gadget/composite.c
parent21bdb3b071a7c6f34999545092bf15480ab95f49 (diff)
parent41f1830f5a7af77cf5c86359aba3cbd706687e52 (diff)
downloadlwn-571949a40a9c00fdaa3d0256cf43c9e0c25ff2d1.tar.gz
lwn-571949a40a9c00fdaa3d0256cf43c9e0c25ff2d1.zip
Merge 4.12-rc6 into usb-next
We want the USB fixes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 49d685ad0da9..45b554032332 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -315,6 +315,9 @@ void usb_remove_function(struct usb_configuration *c, struct usb_function *f)
list_del(&f->list);
if (f->unbind)
f->unbind(c, f);
+
+ if (f->bind_deactivated)
+ usb_function_activate(f);
}
EXPORT_SYMBOL_GPL(usb_remove_function);
@@ -956,12 +959,8 @@ static void remove_config(struct usb_composite_dev *cdev,
f = list_first_entry(&config->functions,
struct usb_function, list);
- list_del(&f->list);
- if (f->unbind) {
- DBG(cdev, "unbind function '%s'/%p\n", f->name, f);
- f->unbind(config, f);
- /* may free memory for "f" */
- }
+
+ usb_remove_function(config, f);
}
list_del(&config->list);
if (config->unbind) {