mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
staging: comedi: usbduxfast: TRIG_EXT only works for 1 or 16 channels
Move this check from the (*do_cmd) to the (*do_cmdtest). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
24b83783ce
commit
d636f87d86
@@ -399,6 +399,11 @@ static int usbduxfast_ai_cmdtest(struct comedi_device *dev,
|
||||
if (!cmd->chanlist_len)
|
||||
err |= -EINVAL;
|
||||
|
||||
/* external start trigger is only valid for 1 or 16 channels */
|
||||
if (cmd->start_src == TRIG_EXT &&
|
||||
cmd->chanlist_len != 1 && cmd->chanlist_len != 16)
|
||||
err |= -EINVAL;
|
||||
|
||||
err |= comedi_check_trigger_arg_is(&cmd->scan_end_arg,
|
||||
cmd->chanlist_len);
|
||||
|
||||
@@ -519,13 +524,6 @@ static int usbduxfast_ai_cmd(struct comedi_device *dev,
|
||||
up(&devpriv->sem);
|
||||
return -EINVAL;
|
||||
}
|
||||
if ((cmd->start_src == TRIG_EXT) && (cmd->chanlist_len != 1)
|
||||
&& (cmd->chanlist_len != 16)) {
|
||||
dev_err(dev->class_dev,
|
||||
"TRIG_EXT only with 1 or 16 channels possible\n");
|
||||
up(&devpriv->sem);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (cmd->chanlist_len) {
|
||||
case 1:
|
||||
|
||||
Reference in New Issue
Block a user