diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-06-24 14:47:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-21 15:16:40 -0700 |
commit | cd9f03759d3eb588e185b04e1854c778b050833e (patch) | |
tree | c4d3ad70cec5c77569c05d6e657b253b2b6253c9 /sound/core/pcm_misc.c | |
parent | 78d9a487ee961c356e1a934d9a92eca38ffb3a70 (diff) |
usbfs: send disconnect signals when device is unregistered
USB device files are accessible in two ways: as files in usbfs and as
character device nodes. The two paths are supposed to behave
identically, but they don't. When the underlying USB device is
unplugged, disconnect signals are sent to processes with open usbfs
files (if they requested these signals) but not to processes with open
device node files.
This patch (as1104) fixes the bug by moving the disconnect-signalling
code into a common subroutine which is called from both paths.
Putting this subroutine in devio.c removes the only out-of-file
reference to struct dev_state, and so the structure's declaration can
be moved from usb.h into devio.c.
Finally, the new subroutine performs one extra action: It kills all
the outstanding async URBs. (I'd kill the outstanding synchronous
URBs too, if there was any way to do it.) In the past this hasn't
mattered much, because devices were unregistered from usbfs only
when they were disconnected. But now the unregistration can also
occur whenever devices are unbound from the usb_generic driver. At
any rate, killing URBs when a device is unregistered from usbfs seems
like a good thing to do.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound/core/pcm_misc.c')
0 files changed, 0 insertions, 0 deletions