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

staging: comedi: cb_pcidas: clarify the ai cmd->start_arg validation

This driver supports two cmd->start_src values, TRIG_NOW and TRIG_EXT.

For aesthetics, replace the default case when validating the cmd->start_arg
with the proper case statement.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2cc3460d
...@@ -872,9 +872,12 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device *dev, ...@@ -872,9 +872,12 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device *dev,
if (err) if (err)
return 2; return 2;
/* step 3: arguments are trivially compatible */ /* Step 3: check if arguments are trivially valid */
switch (cmd->start_src) { switch (cmd->start_src) {
case TRIG_NOW:
err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
break;
case TRIG_EXT: case TRIG_EXT:
/* External trigger, only CR_EDGE and CR_INVERT flags allowed */ /* External trigger, only CR_EDGE and CR_INVERT flags allowed */
if ((cmd->start_arg if ((cmd->start_arg
...@@ -888,9 +891,6 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device *dev, ...@@ -888,9 +891,6 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device *dev,
err |= -EINVAL; err |= -EINVAL;
} }
break; break;
default:
err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
break;
} }
if (cmd->scan_begin_src == TRIG_TIMER) if (cmd->scan_begin_src == TRIG_TIMER)
......
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