diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-04-23 15:52:30 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-25 14:07:50 -0700 |
commit | 0fb21b2c1a057139c096f36d7dce4d38977f3129 (patch) | |
tree | 23aafe6ef05e845944d2dc7a46423fef0d86e33c /drivers/staging/comedi/drivers/adl_pci9111.c | |
parent | e8429b0913a08d5779b93f5dc5e017cd48026b8b (diff) |
staging: comedi: adl_pci9111: clarify Step 2b of the (*do_cmdtest)
This step of the (*do_cmdtest) verifies that the selected trigger sources
are mutually compatible.
For this driver the scan_begin_src must be TRIG_FOLLOW or the same source
as the convert_src.
Simplify the logic to clarify this.
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>
Diffstat (limited to 'drivers/staging/comedi/drivers/adl_pci9111.c')
-rw-r--r-- | drivers/staging/comedi/drivers/adl_pci9111.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c index 6fc85932643c..9225a382a2ae 100644 --- a/drivers/staging/comedi/drivers/adl_pci9111.c +++ b/drivers/staging/comedi/drivers/adl_pci9111.c @@ -379,14 +379,10 @@ static int pci9111_ai_do_cmd_test(struct comedi_device *dev, /* Step 2b : and mutually compatible */ - if ((cmd->convert_src == TRIG_TIMER) && - !((cmd->scan_begin_src == TRIG_TIMER) || - (cmd->scan_begin_src == TRIG_FOLLOW))) - err |= -EINVAL; - if ((cmd->convert_src == TRIG_EXT) && - !((cmd->scan_begin_src == TRIG_EXT) || - (cmd->scan_begin_src == TRIG_FOLLOW))) - err |= -EINVAL; + if (cmd->scan_begin_src != TRIG_FOLLOW) { + if (cmd->scan_begin_src != cmd->convert_src) + err |= -EINVAL; + } if (err) return 2; |