Skip to content

Commit

Permalink
staging: comedi: comedi_fops: introduce comedi_is_subdevice_running()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent 7412071 commit e0dac31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/comedi/comedidev.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ enum subdevice_runflags {
SRF_RUNNING = 0x08000000
};

bool comedi_is_subdevice_running(struct comedi_subdevice *s);

int comedi_check_chanlist(struct comedi_subdevice *s,
int n,
unsigned int *chanlist);
Expand Down

0 comments on commit e0dac31

Please sign in to comment.