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

staging: comedi: adv_pci1710: use cfc_check_trigger_src

Use the helper function cfc_check_trigger_src for the "step 1"
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 60a63228
...@@ -45,6 +45,7 @@ Configuration options: ...@@ -45,6 +45,7 @@ Configuration options:
#include "../comedidev.h" #include "../comedidev.h"
#include "comedi_fc.h"
#include "8253.h" #include "8253.h"
#include "amcc_s5933.h" #include "amcc_s5933.h"
...@@ -1047,30 +1048,11 @@ static int pci171x_ai_cmdtest(struct comedi_device *dev, ...@@ -1047,30 +1048,11 @@ static int pci171x_ai_cmdtest(struct comedi_device *dev,
/* step 1: make sure trigger sources are trivially valid */ /* step 1: make sure trigger sources are trivially valid */
tmp = cmd->start_src; err |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW | TRIG_EXT);
cmd->start_src &= TRIG_NOW | TRIG_EXT; err |= cfc_check_trigger_src(&cmd->scan_begin_src, TRIG_FOLLOW);
if (!cmd->start_src || tmp != cmd->start_src) err |= cfc_check_trigger_src(&cmd->convert_src, TRIG_TIMER | TRIG_EXT);
err++; err |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
err |= cfc_check_trigger_src(&cmd->stop_src, TRIG_COUNT | TRIG_NONE);
tmp = cmd->scan_begin_src;
cmd->scan_begin_src &= TRIG_FOLLOW;
if (!cmd->scan_begin_src || tmp != cmd->scan_begin_src)
err++;
tmp = cmd->convert_src;
cmd->convert_src &= TRIG_TIMER | TRIG_EXT;
if (!cmd->convert_src || tmp != cmd->convert_src)
err++;
tmp = cmd->scan_end_src;
cmd->scan_end_src &= TRIG_COUNT;
if (!cmd->scan_end_src || tmp != cmd->scan_end_src)
err++;
tmp = cmd->stop_src;
cmd->stop_src &= TRIG_COUNT | TRIG_NONE;
if (!cmd->stop_src || tmp != cmd->stop_src)
err++;
if (err) if (err)
return 1; return 1;
......
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