USB: consolidate usb_unbind_interface and usb_driver_release_interface
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 16 Apr 2009 19:35:09 +0000 (15:35 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 16 Jun 2009 04:44:41 +0000 (21:44 -0700)
commit91f8d063d30358fcb76831c238071f7d4b13c35e
tree7755a6a19c0cf74709fb8206f052ce8480a0086b
parent895f28badce96cd903026b0076966e3571b6968e
USB: consolidate usb_unbind_interface and usb_driver_release_interface

This patch (as1230) consolidates code in usb_unbind_interface() and
usb_driver_release_interface().  In fact, it makes release_interface
call unbind_interface, thereby removing the need for duplicated code.

It works like this: If the interface has already been registered with
the driver core when a driver releases it, then the usual driver-core
mechanism will call unbind_interface.  If it hasn't been unregistered
then we will make the call ourselves.

As a nice bonus, drivers now don't have to worry about whether their
disconnect method will get called when they release an interface -- it
always will.  Previously it would be called only if the interface was
registered.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/driver.c