staging: comedi: usbduxfast: chanlist check is Step 5 of (*do_cmdtest)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 24 Aug 2015 17:13:54 +0000 (10:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:23 +0000 (18:24 -0700)
commit99555fc25a5f2a40f0d111a67b13bcd8e8d826b1
treee6c014a9a6fcb20be3bcc8bfb19dfc01208489db
parenta399d81d41e17410ffd7a84af9bd7ec8aafa58a2
staging: comedi: usbduxfast: chanlist check is Step 5 of (*do_cmdtest)

The channel list should be checked in Step 5 of the (*do_cmdtest) not
as part of the (*do_cmd). Factor the check out of usbduxfast_ai_cmd().

Tidy up the factored out code. The channel number 'i' will never be
greater than NUMCHANNELS due to the subdevice setup and the checks
done in the code. The up/down of the semaphore is also not needed
because the (*do_cmdtest) never actually tries to access the hardware.

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>
drivers/staging/comedi/drivers/usbduxfast.c