staging: comedi: comedi_fops: eliminate a use of subdevice spin-lock
`comedi_is_subdevice_in_error()` is only used by `comedi_read()` and `comedi_write()` and is only called (soon) after `comedi_is_subdevice_running()` returns `false` (with extra conditions in the case of `comedi_write()`). `comedi_is_subdevice_running()` and `comedi_get_subdevice_runflags()` both call `comedi_get_subdevice_runflags()` which uses the subdevice's spin-lock. Eliminate one use of the subdevice's spin-lock in `comedi_read()` and `comedi_write()` by calling `comedi_get_subdevice_runflags()` and checking the runflags directly. Add a couple of inline functions to check the runflags: `comedi_is_runflags_running()` and `comedi_is_runflags_in_error()`. These do the same test on runflags as `comedi_is_subdevice_running()` and `comedi_is_subdevice_in_error()` but get passed the runflags value directly. `comedi_is_subdevice_in_error()` is no longer used, so remove it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
Please register or sign in to comment