On 14/08/15 22:29, H Hartley Sweeten wrote:
The (*do_cmdtest) properly checks the MIN_SAMPLE_PERIOD. Remove the
redundant check in the (*do_cmd).
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/usbduxfast.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/staging/comedi/drivers/usbduxfast.c
b/drivers/staging/comedi/drivers/usbduxfast.c
index 649d56e..3468c03 100644
--- a/drivers/staging/comedi/drivers/usbduxfast.c
+++ b/drivers/staging/comedi/drivers/usbduxfast.c
@@ -512,14 +512,6 @@ static int usbduxfast_ai_cmd(struct comedi_device *dev,
if (cmd->convert_src == TRIG_TIMER)
steps = (cmd->convert_arg * 30) / 1000;
- if ((steps < MIN_SAMPLING_PERIOD) && (cmd->chanlist_len != 1)) {
- dev_err(dev->class_dev,
- "steps=%ld, scan_begin_arg=%d. Not properly tested by
cmdtest?\n",
- steps, cmd->scan_begin_arg);
- up(&devpriv->sem);
- return -EINVAL;
- }
-
I'm wondering what happens when cmd->convert_src == TRIG_EXT? In that
case, 'steps' would have its initial value of 0 in the above code, which
would imply that chanlist_len would need to be 1.
The remainder of usbduxfast_ai_cmd() doesn't seem to have any support
for cmd->convert_src == TRIG_EXT nor for cmd->scan_begin_src ==
TRIG_EXT, i.e. it doesn't set things up any differently. It seems to
assume cmd->scan_begin_src == TRIG_FOLLOW and cmd->convert_src ==
TRIG_TIMER. So I guess the usbduxfast_ai_cmdtest() should be modified
to only allow that.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbo...@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel