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

staging: comedi: adl_pci9111: use cfc_check_trigger_is_unique

Use the helper function cfc_check_trigger_is_unique.
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 6c39eed0
...@@ -366,27 +366,22 @@ static int pci9111_ai_do_cmd_test(struct comedi_device *dev, ...@@ -366,27 +366,22 @@ static int pci9111_ai_do_cmd_test(struct comedi_device *dev,
if (error) if (error)
return 1; return 1;
/* step 2 : make sure trigger sources are unique and mutually /* Step 2a : make sure trigger sources are unique */
* compatible */
if ((cmd->scan_begin_src != TRIG_TIMER) && error |= cfc_check_trigger_is_unique(cmd->scan_begin_src);
(cmd->scan_begin_src != TRIG_FOLLOW) && error |= cfc_check_trigger_is_unique(cmd->convert_src);
(cmd->scan_begin_src != TRIG_EXT)) error |= cfc_check_trigger_is_unique(cmd->stop_src);
error++;
/* Step 2b : and mutually compatible */
if ((cmd->convert_src != TRIG_TIMER) && (cmd->convert_src != TRIG_EXT))
error++;
if ((cmd->convert_src == TRIG_TIMER) && if ((cmd->convert_src == TRIG_TIMER) &&
!((cmd->scan_begin_src == TRIG_TIMER) || !((cmd->scan_begin_src == TRIG_TIMER) ||
(cmd->scan_begin_src == TRIG_FOLLOW))) (cmd->scan_begin_src == TRIG_FOLLOW)))
error++; error |= -EINVAL;
if ((cmd->convert_src == TRIG_EXT) && if ((cmd->convert_src == TRIG_EXT) &&
!((cmd->scan_begin_src == TRIG_EXT) || !((cmd->scan_begin_src == TRIG_EXT) ||
(cmd->scan_begin_src == TRIG_FOLLOW))) (cmd->scan_begin_src == TRIG_FOLLOW)))
error++; error |= -EINVAL;
if ((cmd->stop_src != TRIG_COUNT) && (cmd->stop_src != TRIG_NONE))
error++;
if (error) if (error)
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