summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorH Hartley Sweeten2012-12-19 23:42:47 +0100
committerGreg Kroah-Hartman2013-01-07 23:25:48 +0100
commite0dac318ee2807d5ec1b09c1a608fdc25ef2ac7b (patch)
treedf457dba82e8319f2f8e0ae187b2fce48f7df305 /drivers/staging/comedi/comedi_fops.c
parentstaging: comedi: comedi_fops: move comedi_get_subdevice_runflags() (diff)
downloadkernel-qcow2-linux-e0dac318ee2807d5ec1b09c1a608fdc25ef2ac7b.tar.gz
kernel-qcow2-linux-e0dac318ee2807d5ec1b09c1a608fdc25ef2ac7b.tar.xz
kernel-qcow2-linux-e0dac318ee2807d5ec1b09c1a608fdc25ef2ac7b.zip
staging: comedi: comedi_fops: introduce comedi_is_subdevice_running()
Introduce a helper function that checks the subdevice runflags to see if the subdevice is running a command. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r--drivers/staging/comedi/comedi_fops.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 0161f94cd759..368dbc90da3b 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -375,6 +375,14 @@ unsigned comedi_get_subdevice_runflags(struct comedi_subdevice *s)
}
EXPORT_SYMBOL(comedi_get_subdevice_runflags);
+bool comedi_is_subdevice_running(struct comedi_subdevice *s)
+{
+ unsigned runflags = comedi_get_subdevice_runflags(s);
+
+ return (runflags & SRF_RUNNING) ? true : false;
+}
+EXPORT_SYMBOL_GPL(comedi_is_subdevice_running);
+
/*
This function restores a subdevice to an idle state.
*/