Regardless of the cmd->scan_begin_src, the minimum cmd->convert_arg
value is 10000 (10us). Fix the validation in apci3120_ai_cmdtest().

Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c 
b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
index b650742..3ee1ecd 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
@@ -118,13 +118,8 @@ static int apci3120_ai_cmdtest(struct comedi_device *dev,
        if (cmd->scan_begin_src == TRIG_TIMER)  /* Test Delay timing */
                err |= cfc_check_trigger_arg_min(&cmd->scan_begin_arg, 100000);
 
-       if (cmd->scan_begin_src == TRIG_TIMER) {
-               if (cmd->convert_arg)
-                       err |= cfc_check_trigger_arg_min(&cmd->convert_arg,
-                                                        10000);
-       } else {
-               err |= cfc_check_trigger_arg_min(&cmd->convert_arg, 10000);
-       }
+       /* minimum conversion time per sample is 10us */
+       err |= cfc_check_trigger_arg_min(&cmd->convert_arg, 10000);
 
        err |= cfc_check_trigger_arg_min(&cmd->chanlist_len, 1);
        err |= cfc_check_trigger_arg_is(&cmd->scan_end_arg, cmd->chanlist_len);
-- 
2.0.3

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to