From: H Hartley Sweeten Date: Tue, 4 Nov 2014 17:55:16 +0000 (-0700) Subject: staging: comedi: addi_apci_3120: fix cmd->convert_arg vaildation X-Git-Tag: v3.19-rc1~66^2~263 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=38417cc46f50dcaf9d2f1e6bfd9ff0b3531a9eba;p=karo-tx-linux.git staging: comedi: addi_apci_3120: fix cmd->convert_arg vaildation 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c index b6507427712c..3ee1ecd72406 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);