staging: comedi: usbduxsigma: round down AI scan_begin_arg at step 4.
authorIan Abbott <abbotti@mev.co.uk>
Thu, 23 Jul 2015 15:47:00 +0000 (16:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jul 2015 20:32:28 +0000 (13:32 -0700)
commit333e40aee3f2d0457e2cbadc742619a6f449b2e7
tree5dac2abec46b7f01dc595ddd0423973b1c06d8f7
parent12e1e6960130673aabbbe7f094c4690b00618881
staging: comedi: usbduxsigma: round down AI scan_begin_arg at step 4.

The return value of the `cmdtest` handler for a subdevice checks the
prospective new command in various steps and returns the step number at
which any problem was detected, or 0 if no problem was detected.  It is
allowed to modify the command in various ways at each step.  Corrections
for out-of-range values are generally made at step 3, and minor
adjustments such as rounding are generally made at step 4.

The `cmdtest` handler for the AI subdevice (`usbduxsigma_ai_cmdtest()`)
currently modifies `cmd->scan_begin_arg` to bring it into range and
round it down at step 3.  Move the rounding down part to step 4 to
follow the usual Comedi convention.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: Bernd Porr <mail@berndporr.me.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/usbduxsigma.c
This page took 0.025331 seconds and 5 git commands to generate.