]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/blobdiff - drivers/usb/gadget/composite.c
Merge branch 'p-ti-linux-3.14.y-common' into p-ti-linux-3.14.y-android
[android-sdk/kernel-video.git] / drivers / usb / gadget / composite.c
index b89b543cdd087e5532042407f4fe7a4ae9bdd77a..8f1f0d2b5df4b48d4c0299dbec2403cc39e6d381 100644 (file)
@@ -845,7 +845,7 @@ done:
 }
 EXPORT_SYMBOL_GPL(usb_add_config);
 
-static void remove_config(struct usb_composite_dev *cdev,
+static void unbind_config(struct usb_composite_dev *cdev,
                              struct usb_configuration *config)
 {
        while (!list_empty(&config->functions)) {
@@ -860,7 +860,6 @@ static void remove_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);
@@ -887,9 +886,11 @@ 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);
 
-       remove_config(cdev, config);
+       unbind_config(cdev, config);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -1820,7 +1821,8 @@ 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);
-               remove_config(cdev, c);
+               list_del(&c->list);
+               unbind_config(cdev, c);
        }
        if (cdev->driver->unbind && unbind_driver)
                cdev->driver->unbind(cdev);