Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151320
b: refs/heads/master
c: 91f8d06
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jun 16, 2009
1 parent ccd61f5 commit 63cf38a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 895f28badce96cd903026b0076966e3571b6968e
refs/heads/master: 91f8d063d30358fcb76831c238071f7d4b13c35e
21 changes: 8 additions & 13 deletions trunk/drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ void usb_driver_release_interface(struct usb_driver *driver,
struct usb_interface *iface)
{
struct device *dev = &iface->dev;
struct usb_device *udev = interface_to_usbdev(iface);

/* this should never happen, don't release something that's not ours */
if (!dev->driver || dev->driver != &driver->drvwrap.driver)
Expand All @@ -394,23 +393,19 @@ void usb_driver_release_interface(struct usb_driver *driver,
/* don't release from within disconnect() */
if (iface->condition != USB_INTERFACE_BOUND)
return;
iface->condition = USB_INTERFACE_UNBINDING;

/* don't release if the interface hasn't been added yet */
/* Release via the driver core only if the interface
* has already been registered
*/
if (device_is_registered(dev)) {
iface->condition = USB_INTERFACE_UNBINDING;
device_release_driver(dev);
} else {
iface->condition = USB_INTERFACE_UNBOUND;
usb_cancel_queued_reset(iface);
down(&dev->sem);
usb_unbind_interface(dev);
dev->driver = NULL;
up(&dev->sem);
}
dev->driver = NULL;
usb_set_intfdata(iface, NULL);

usb_pm_lock(udev);
iface->condition = USB_INTERFACE_UNBOUND;
mark_quiesced(iface);
iface->needs_remote_wakeup = 0;
usb_pm_unlock(udev);
}
EXPORT_SYMBOL_GPL(usb_driver_release_interface);

Expand Down

0 comments on commit 63cf38a

Please sign in to comment.