aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/core/hub.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index e65881899c8f..ff066edf4dca 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1636,6 +1636,10 @@ int usb_new_device(struct usb_device *udev)
1636{ 1636{
1637 int err; 1637 int err;
1638 1638
1639 /* Increment the parent's count of unsuspended children */
1640 if (udev->parent)
1641 usb_autoresume_device(udev->parent);
1642
1639 usb_detect_quirks(udev); /* Determine quirks */ 1643 usb_detect_quirks(udev); /* Determine quirks */
1640 err = usb_configure_device(udev); /* detect & probe dev/intfs */ 1644 err = usb_configure_device(udev); /* detect & probe dev/intfs */
1641 if (err < 0) 1645 if (err < 0)
@@ -1644,9 +1648,8 @@ int usb_new_device(struct usb_device *udev)
1644 udev->dev.devt = MKDEV(USB_DEVICE_MAJOR, 1648 udev->dev.devt = MKDEV(USB_DEVICE_MAJOR,
1645 (((udev->bus->busnum-1) * 128) + (udev->devnum-1))); 1649 (((udev->bus->busnum-1) * 128) + (udev->devnum-1)));
1646 1650
1647 /* Increment the parent's count of unsuspended children */ 1651 /* Tell the world! */
1648 if (udev->parent) 1652 announce_device(udev);
1649 usb_autoresume_device(udev->parent);
1650 1653
1651 /* Register the device. The device driver is responsible 1654 /* Register the device. The device driver is responsible
1652 * for adding the device files to sysfs and for configuring 1655 * for adding the device files to sysfs and for configuring
@@ -1660,13 +1663,11 @@ int usb_new_device(struct usb_device *udev)
1660 1663
1661 /* put device-specific files into sysfs */ 1664 /* put device-specific files into sysfs */
1662 usb_create_sysfs_dev_files(udev); 1665 usb_create_sysfs_dev_files(udev);
1663
1664 /* Tell the world! */
1665 announce_device(udev);
1666 return err; 1666 return err;
1667 1667
1668fail: 1668fail:
1669 usb_set_device_state(udev, USB_STATE_NOTATTACHED); 1669 usb_set_device_state(udev, USB_STATE_NOTATTACHED);
1670 usb_stop_pm(udev);
1670 return err; 1671 return err;
1671} 1672}
1672 1673