]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/usb/core/config.c
[PATCH] parport: section mismatches with HOTPLUG=n
[mv-sheeva.git] / drivers / usb / core / config.c
index 63f374e62db207395f76055701657fb26f5b7e21..bfb3731d42db816531a4cacd69d692ff04727827 100644 (file)
@@ -1,9 +1,3 @@
-#include <linux/config.h>
-
-#ifdef CONFIG_USB_DEBUG
-#define DEBUG
-#endif
-
 #include <linux/usb.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -112,8 +106,12 @@ void usb_release_interface_cache(struct kref *ref)
        struct usb_interface_cache *intfc = ref_to_usb_interface_cache(ref);
        int j;
 
-       for (j = 0; j < intfc->num_altsetting; j++)
-               kfree(intfc->altsetting[j].endpoint);
+       for (j = 0; j < intfc->num_altsetting; j++) {
+               struct usb_host_interface *alt = &intfc->altsetting[j];
+
+               kfree(alt->endpoint);
+               kfree(alt->string);
+       }
        kfree(intfc);
 }
 
@@ -420,8 +418,6 @@ void usb_destroy_configuration(struct usb_device *dev)
                struct usb_host_config *cf = &dev->config[c];
 
                kfree(cf->string);
-               cf->string = NULL;
-
                for (i = 0; i < cf->desc.bNumInterfaces; i++) {
                        if (cf->intf_cache[i])
                                kref_put(&cf->intf_cache[i]->ref, 
@@ -479,7 +475,9 @@ int usb_get_configuration(struct usb_device *dev)
                if (result < 0) {
                        dev_err(ddev, "unable to read config index %d "
                            "descriptor/%s\n", cfgno, "start");
-                       goto err;
+                       dev_err(ddev, "chopping to %d config(s)\n", cfgno);
+                       dev->descriptor.bNumConfigurations = cfgno;
+                       break;
                } else if (result < 4) {
                        dev_err(ddev, "config index %d descriptor too short "
                            "(expected %i, got %i)\n", cfgno,