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

staging: comedi: cb_pcidas: trigger sources are validated in (*do_cmdtest)

The trigger sources were already validataed in the (*do_cmdtest) before the
(*do_cmd) is called. Refactor the code in cb_pcidas_ai_cmd() to remove the
final else which can never be reached.
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 654410c9
...@@ -1017,9 +1017,9 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev, ...@@ -1017,9 +1017,9 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
/* set start trigger and burst mode */ /* set start trigger and burst mode */
bits = 0; bits = 0;
if (cmd->start_src == TRIG_NOW) if (cmd->start_src == TRIG_NOW) {
bits |= SW_TRIGGER; bits |= SW_TRIGGER;
else if (cmd->start_src == TRIG_EXT) { } else { /* TRIG_EXT */
bits |= EXT_TRIGGER | TGEN | XTRCL; bits |= EXT_TRIGGER | TGEN | XTRCL;
if (thisboard->is_1602) { if (thisboard->is_1602) {
if (cmd->start_arg & CR_INVERT) if (cmd->start_arg & CR_INVERT)
...@@ -1027,9 +1027,6 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev, ...@@ -1027,9 +1027,6 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
if (cmd->start_arg & CR_EDGE) if (cmd->start_arg & CR_EDGE)
bits |= TGSEL; bits |= TGSEL;
} }
} else {
comedi_error(dev, "bug!");
return -1;
} }
if (cmd->convert_src == TRIG_NOW && cmd->chanlist_len > 1) if (cmd->convert_src == TRIG_NOW && cmd->chanlist_len > 1)
bits |= BURSTE; bits |= BURSTE;
......
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