Commit b7f16de6 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: adv_pci1710: use cfc_check_trigger_is_unique

Use the helper function cfc_check_trigger_is_unique for the "step 2a"
tests of pci171x_ai_cmdtest().
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 85f3088b
...@@ -1057,18 +1057,13 @@ static int pci171x_ai_cmdtest(struct comedi_device *dev, ...@@ -1057,18 +1057,13 @@ static int pci171x_ai_cmdtest(struct comedi_device *dev,
if (err) if (err)
return 1; return 1;
/* step2: make sure trigger srcs are unique and mutually compatible */ /* step 2a: make sure trigger sources are unique */
if (cmd->start_src != TRIG_NOW && cmd->start_src != TRIG_EXT) { err |= cfc_check_trigger_is_unique(cmd->start_src);
cmd->start_src = TRIG_NOW; err |= cfc_check_trigger_is_unique(cmd->convert_src);
err++; err |= cfc_check_trigger_is_unique(cmd->stop_src);
}
if (cmd->convert_src != TRIG_TIMER && cmd->convert_src != TRIG_EXT) /* step 2b: and mutually compatible */
err++;
if (cmd->stop_src != TRIG_NONE && cmd->stop_src != TRIG_COUNT)
err++;
if (err) if (err)
return 2; return 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment