Skip to content

Commit

Permalink
staging: comedi: cb_pcidas: trigger sources are validated in (*do_cmd…
Browse files Browse the repository at this point in the history
…test)

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: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Feb 14, 2014
1 parent 654410c commit 8abc728
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/staging/comedi/drivers/cb_pcidas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,19 +1017,16 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,

/* set start trigger and burst mode */
bits = 0;
if (cmd->start_src == TRIG_NOW)
if (cmd->start_src == TRIG_NOW) {
bits |= SW_TRIGGER;
else if (cmd->start_src == TRIG_EXT) {
} else { /* TRIG_EXT */
bits |= EXT_TRIGGER | TGEN | XTRCL;
if (thisboard->is_1602) {
if (cmd->start_arg & CR_INVERT)
bits |= TGPOL;
if (cmd->start_arg & CR_EDGE)
bits |= TGSEL;
}
} else {
comedi_error(dev, "bug!");
return -1;
}
if (cmd->convert_src == TRIG_NOW && cmd->chanlist_len > 1)
bits |= BURSTE;
Expand Down

0 comments on commit 8abc728

Please sign in to comment.