staging: comedi: adl_pci9111: use cfc_check_trigger_src
Remove the pci9111_check_trigger_src macro and use the helper function cfc_check_trigger_src instead. 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>
This commit is contained in:
parent
43b9778eeb
commit
97e01bb10a
1 changed files with 12 additions and 19 deletions
|
@ -342,18 +342,9 @@ static int pci9111_ai_cancel(struct comedi_device *dev,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test analog input command */
|
static int pci9111_ai_do_cmd_test(struct comedi_device *dev,
|
||||||
|
struct comedi_subdevice *s,
|
||||||
#define pci9111_check_trigger_src(src, flags) do { \
|
struct comedi_cmd *cmd)
|
||||||
tmp = src; \
|
|
||||||
src &= flags; \
|
|
||||||
if (!src || tmp != src) \
|
|
||||||
error++; \
|
|
||||||
} while (false);
|
|
||||||
|
|
||||||
static int
|
|
||||||
pci9111_ai_do_cmd_test(struct comedi_device *dev,
|
|
||||||
struct comedi_subdevice *s, struct comedi_cmd *cmd)
|
|
||||||
{
|
{
|
||||||
struct pci9111_private_data *dev_private = dev->private;
|
struct pci9111_private_data *dev_private = dev->private;
|
||||||
int tmp;
|
int tmp;
|
||||||
|
@ -361,14 +352,16 @@ pci9111_ai_do_cmd_test(struct comedi_device *dev,
|
||||||
int range, reference;
|
int range, reference;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Step 1 : check if trigger are trivialy valid */
|
/* Step 1 : check if trigger are trivialy valid */
|
||||||
|
|
||||||
pci9111_check_trigger_src(cmd->start_src, TRIG_NOW);
|
error |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW);
|
||||||
pci9111_check_trigger_src(cmd->scan_begin_src,
|
error |= cfc_check_trigger_src(&cmd->scan_begin_src,
|
||||||
TRIG_TIMER | TRIG_FOLLOW | TRIG_EXT);
|
TRIG_TIMER | TRIG_FOLLOW | TRIG_EXT);
|
||||||
pci9111_check_trigger_src(cmd->convert_src, TRIG_TIMER | TRIG_EXT);
|
error |= cfc_check_trigger_src(&cmd->convert_src,
|
||||||
pci9111_check_trigger_src(cmd->scan_end_src, TRIG_COUNT);
|
TRIG_TIMER | TRIG_EXT);
|
||||||
pci9111_check_trigger_src(cmd->stop_src, TRIG_COUNT | TRIG_NONE);
|
error |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
|
||||||
|
error |= cfc_check_trigger_src(&cmd->stop_src,
|
||||||
|
TRIG_COUNT | TRIG_NONE);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue