From 8e4d19e65a64a9bb510a0fc8508bb9489838837b Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Mon, 16 Jul 2007 15:28:19 -0400 Subject: [PATCH] --- yaml --- r: 61933 b: refs/heads/master c: 195af2cce5ff81c4609c7ba585b6698a7771cbfc h: refs/heads/master i: 61931: c02b474565b68794c4e4805575fc46e139b9a204 v: v3 --- [refs] | 2 +- trunk/drivers/usb/core/hub.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index f0ee316b7af0..896a7beca16e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 69d42a78f935d19384d1f6e4f94b65bb162b36df +refs/heads/master: 195af2cce5ff81c4609c7ba585b6698a7771cbfc diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index fd74c50b1804..e341a1da517f 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -1335,6 +1335,10 @@ int usb_new_device(struct usb_device *udev) udev->dev.devt = MKDEV(USB_DEVICE_MAJOR, (((udev->bus->busnum-1) * 128) + (udev->devnum-1))); + /* Increment the parent's count of unsuspended children */ + if (udev->parent) + usb_autoresume_device(udev->parent); + /* Register the device. The device driver is responsible * for adding the device files to sysfs and for configuring * the device. @@ -1342,13 +1346,11 @@ int usb_new_device(struct usb_device *udev) err = device_add(&udev->dev); if (err) { dev_err(&udev->dev, "can't device_add, error %d\n", err); + if (udev->parent) + usb_autosuspend_device(udev->parent); goto fail; } - /* Increment the parent's count of unsuspended children */ - if (udev->parent) - usb_autoresume_device(udev->parent); - exit: return err;