USB: fix char-device disconnect handling
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 13 Jan 2009 16:33:42 +0000 (11:33 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Feb 2009 16:28:11 +0000 (08:28 -0800)
commitbb74fdbb0c7138a397b58141791eae4b2e7e4cfe
treef3b991b580956bb69c874548b8747c76c60b51d1
parent010703af998cf0c3927cb587d88641ed5a3ef358
USB: fix char-device disconnect handling

commit 501950d846218ed80a776d2aae5aed9c8b92e778 upstream.

This patch (as1198) fixes a conceptual bug: Somewhere along the line
we managed to confuse USB class devices with USB char devices.  As a
result, the code to send a disconnect signal to userspace would not be
built if both CONFIG_USB_DEVICE_CLASS and CONFIG_USB_DEVICEFS were
disabled.

The usb_fs_classdev_common_remove() routine has been renamed to
usbdev_remove() and it is now called whenever any USB device is
removed, not just when a class device is unregistered.  The notifier
registration and unregistration calls are no longer conditionally
compiled.  And since the common removal code will always be called as
part of the char device interface, there's no need to call it again as
part of the usbfs interface; thus the invocation of
usb_fs_classdev_common_remove() has been taken out of
usbfs_remove_device().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Alon Bar-Lev <alon.barlev@gmail.com>
Tested-by: Alon Bar-Lev <alon.barlev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/devio.c
drivers/usb/core/inode.c
drivers/usb/core/usb.h