diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2013-11-08 15:03:28 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-11-11 16:16:44 -0800 |
commit | d19db51a0eeb659cd924a9d08b20a2ed4ee46b15 (patch) | |
tree | bed15b7a8d0dd01f0d5dfbffced7e0282c5ae65a /drivers/staging/comedi/comedi_internal.h | |
parent | 8da8c86f52e5487adfa2e3bae4d539e46f2714dd (diff) | |
download | op-kernel-dev-d19db51a0eeb659cd924a9d08b20a2ed4ee46b15.zip op-kernel-dev-d19db51a0eeb659cd924a9d08b20a2ed4ee46b15.tar.gz |
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>
Diffstat (limited to 'drivers/staging/comedi/comedi_internal.h')
-rw-r--r-- | drivers/staging/comedi/comedi_internal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedi_internal.h b/drivers/staging/comedi/comedi_internal.h index fda1a7b..151693b 100644 --- a/drivers/staging/comedi/comedi_internal.h +++ b/drivers/staging/comedi/comedi_internal.h @@ -17,6 +17,7 @@ int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s, unsigned long new_size); void comedi_buf_reset(struct comedi_async *async); unsigned int comedi_buf_write_n_allocated(struct comedi_async *async); +void comedi_device_cancel_all(struct comedi_device *dev); extern unsigned int comedi_default_buf_size_kb; extern unsigned int comedi_default_buf_maxsize_kb; |