]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/core/generic.c
s390/net/ctcm: message cleanup
[linux-2.6-omap-h63xx.git] / drivers / usb / core / generic.c
index 20b095050a163a06e5aef0a209fa1ae69e57a5f4..7e912f21fd365fc7240bc8c698c43ce2a817cc6b 100644 (file)
@@ -40,7 +40,7 @@ static int is_activesync(struct usb_interface_descriptor *desc)
                && desc->bInterfaceProtocol == 1;
 }
 
-static int choose_configuration(struct usb_device *udev)
+int usb_choose_configuration(struct usb_device *udev)
 {
        int i;
        int num_configs;
@@ -155,16 +155,13 @@ static int generic_probe(struct usb_device *udev)
 {
        int err, c;
 
-       /* put device-specific files into sysfs */
-       usb_create_sysfs_dev_files(udev);
-
        /* Choose and set the configuration.  This registers the interfaces
         * with the driver core and lets interface drivers bind to them.
         */
        if (udev->authorized == 0)
                dev_err(&udev->dev, "Device is not authorized for usage\n");
        else {
-               c = choose_configuration(udev);
+               c = usb_choose_configuration(udev);
                if (c >= 0) {
                        err = usb_set_configuration(udev, c);
                        if (err) {
@@ -189,8 +186,6 @@ static void generic_disconnect(struct usb_device *udev)
         * unconfigure the device */
        if (udev->actconfig)
                usb_set_configuration(udev, -1);
-
-       usb_remove_sysfs_dev_files(udev);
 }
 
 #ifdef CONFIG_PM
@@ -206,8 +201,13 @@ static int generic_suspend(struct usb_device *udev, pm_message_t msg)
         */
        if (!udev->parent)
                rc = hcd_bus_suspend(udev);
+
+       /* Non-root devices don't need to do anything for FREEZE or PRETHAW */
+       else if (msg.event == PM_EVENT_FREEZE || msg.event == PM_EVENT_PRETHAW)
+               rc = 0;
        else
                rc = usb_port_suspend(udev);
+
        return rc;
 }