staging: comedi: comedi_fops: eliminate a use of subdevice spin-lock
authorIan Abbott <abbotti@mev.co.uk>
Fri, 27 Mar 2015 15:13:01 +0000 (15:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Apr 2015 11:11:53 +0000 (13:11 +0200)
commitb183a836fe02a59c2b55273655196ba288f3adb7
tree2e28d77dabde4062feaebb605b5c235c05000cb3
parentcc64ea4239c354d30f88130ecf5aa81a506b57e3
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>
drivers/staging/comedi/comedi_fops.c
This page took 0.025704 seconds and 5 git commands to generate.