]> err.no Git - linux-2.6/commit
USB: rework sysfs removal of interface files
authorAlan Stern <stern@rowland.harvard.edu>
Sat, 5 Apr 2008 03:46:59 +0000 (23:46 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Apr 2008 04:16:48 +0000 (21:16 -0700)
commit61a5c657892a43653d6189972159590751a0673e
tree3e3da283513b7cde81c0ccd5a67692500a196afb
parent96e12fced365262e185a8e935db23973337b8a2a
USB: rework sysfs removal of interface files

Removing an interface's sysfs files before unregistering the interface
doesn't work properly, because usb_unbind_interface() will reinstall
altsetting 0 and thereby create new sysfs files.  This patch (as1074)
removes the files after the unregistration is finished.  It's not
quite as clean, but at least it works.

Also, there's no need to check if an interface has been registered
before removing its sysfs files.  If it hasn't been registered then
the files won't have been created, so usb_remove_sysfs_intf_files()
will simply do nothing.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/message.c