Skip to content

Commit

Permalink
staging: comedi: pcl812: trigger sources were validated in (*do_cmdtest)
Browse files Browse the repository at this point in the history
The trigger sources were already validataed in the (*do_cmdtest) before the
(*do_cmd) is called. Remove the unnecessary checks in pcl812_ai_cmd().

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 b41b267 commit c599235
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions drivers/staging/comedi/drivers/pcl812.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,24 +631,6 @@ static int pcl812_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
unsigned int divisor1 = 0, divisor2 = 0, i, dma_flags, bytes;
struct comedi_cmd *cmd = &s->async->cmd;

if (cmd->start_src != TRIG_NOW)
return -EINVAL;
if (cmd->scan_begin_src != TRIG_FOLLOW)
return -EINVAL;
if (devpriv->use_ext_trg) {
if (cmd->convert_src != TRIG_EXT)
return -EINVAL;
} else {
if (cmd->convert_src != TRIG_TIMER)
return -EINVAL;
}
if (cmd->scan_end_src != TRIG_COUNT)
return -EINVAL;
if (cmd->scan_end_arg != cmd->chanlist_len)
return -EINVAL;
if (cmd->chanlist_len > MAX_CHANLIST_LEN)
return -EINVAL;

if (cmd->convert_src == TRIG_TIMER) {
if (cmd->convert_arg < board->ai_ns_min)
cmd->convert_arg = board->ai_ns_min;
Expand Down

0 comments on commit c599235

Please sign in to comment.