staging: comedi: cancel commands before detaching device
authorIan Abbott <abbotti@mev.co.uk>
Fri, 8 Nov 2013 15:03:28 +0000 (15:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2013 00:16:44 +0000 (16:16 -0800)
commitd19db51a0eeb659cd924a9d08b20a2ed4ee46b15
treebed15b7a8d0dd01f0d5dfbffced7e0282c5ae65a
parent8da8c86f52e5487adfa2e3bae4d539e46f2714dd
staging: comedi: cancel commands before detaching device

The comedi core module's handling of the `COMEDI_DEVCONFIG` ioctl will
not allow a device to be detached if it is busy.  However, comedi
devices can also be auto-detached due to a removal of a hardware device.
One of the things we should do in that case is cancel any asynchronous
commands that are running.  Add a new function
`comedi_device_cancel_all()` to do that and call it from
`comedi_device_detach()`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c
drivers/staging/comedi/comedi_internal.h
drivers/staging/comedi/drivers.c