diff options
| -rw-r--r-- | drivers/usb/core/driver.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 7652dcb57998..a1f225f077cd 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
| @@ -550,6 +550,21 @@ int usb_driver_claim_interface(struct usb_driver *driver, | |||
| 550 | if (device_is_registered(dev)) | 550 | if (device_is_registered(dev)) |
| 551 | retval = device_bind_driver(dev); | 551 | retval = device_bind_driver(dev); |
| 552 | 552 | ||
| 553 | if (retval) { | ||
| 554 | dev->driver = NULL; | ||
| 555 | usb_set_intfdata(iface, NULL); | ||
| 556 | iface->needs_remote_wakeup = 0; | ||
| 557 | iface->condition = USB_INTERFACE_UNBOUND; | ||
| 558 | |||
| 559 | /* | ||
| 560 | * Unbound interfaces are always runtime-PM-disabled | ||
| 561 | * and runtime-PM-suspended | ||
| 562 | */ | ||
| 563 | if (driver->supports_autosuspend) | ||
| 564 | pm_runtime_disable(dev); | ||
| 565 | pm_runtime_set_suspended(dev); | ||
| 566 | } | ||
| 567 | |||
| 553 | return retval; | 568 | return retval; |
| 554 | } | 569 | } |
| 555 | EXPORT_SYMBOL_GPL(usb_driver_claim_interface); | 570 | EXPORT_SYMBOL_GPL(usb_driver_claim_interface); |
