aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 08:25:49 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 08:25:49 -0700
commit52a23685f37c06d0cd00eeb8f517a90de3f2c338 (patch)
tree1449bf12db013962c98b2b8cd9b4b5d1cf359b01 /drivers/usb/core/hub.c
parentd046943cbaf332f75284ad99f4b3e60bae7ffff2 (diff)
parentd20da3c39b9d5b04f0258ba74643533268f56e30 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (44 commits) USB: drivers/usb/storage/dpcm.c whitespace cleanup USB: r8a66597-hcd: fixes some problem USB: change name of spinlock in hcd.c USB: move routines in hcd.c USB: misc: uss720: clean up urb->status usage USB: misc: usbtest: clean up urb->status usage USB: misc: usblcd: clean up urb->status usage USB: misc: phidgetmotorcontrol: clean up urb->status usage USB: misc: phidgetkit: clean up urb->status usage USB: misc: legousbtower: clean up urb->status usage USB: misc: ldusb: clean up urb->status usage USB: misc: iowarrior: clean up urb->status usage USB: misc: ftdi-elan: clean up urb->status usage USB: misc: auerswald: clean up urb->status usage USB: misc: appledisplay: clean up urb->status usage USB: misc: adtux: clean up urb->status usage USB: core: message: clean up urb->status usage USB: image: microtek: clean up urb->status usage USB: image: mdc800: clean up urb->status usage USB: storage: onetouch: clean up urb->status usage ...
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index fd74c50b180..e341a1da517 100644
--- a/drivers/usb/core/hub.c
+++ b/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;