diff --git a/[refs] b/[refs] index 414ed9f3a1af..0d90c91a863b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3ea15966ed59f2bc20928c7b0496b4585f6de206 +refs/heads/master: 3b4d7f79164853e10342d707e32307e0c8054982 diff --git a/trunk/drivers/usb/core/usb.c b/trunk/drivers/usb/core/usb.c index 109f7558167a..087af73a59dd 100644 --- a/trunk/drivers/usb/core/usb.c +++ b/trunk/drivers/usb/core/usb.c @@ -65,6 +65,16 @@ static int generic_probe (struct device *dev) } static int generic_remove (struct device *dev) { + struct usb_device *udev = to_usb_device(dev); + + /* if this is only an unbind, not a physical disconnect, then + * unconfigure the device */ + if (udev->state == USB_STATE_CONFIGURED) + usb_set_configuration(udev, 0); + + /* in case the call failed or the device was suspended */ + if (udev->state >= USB_STATE_CONFIGURED) + usb_disable_device(udev, 0); return 0; }