OSDN Git Service

staging: comedi: cb_pcimdas: fix analog input channel configuration
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 25 Feb 2015 23:28:38 +0000 (16:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Mar 2015 02:56:30 +0000 (18:56 -0800)
commit532a411e8b54418c2aed9e20f02b359002bb7e44
tree8cf6f2f79033cfb98066606cb242ee6bf2a0763f
parentbca3a6d182b1deae02e5cbc05e727c75427e82ee
staging: comedi: cb_pcimdas: fix analog input channel configuration

The hardware uses a switch on the board to set the number of analog
input channels to either 16 single-ended or 8 differential channels.
Currently the switch setting is checked for every (*insn_read) operation
to validate the channel number.

Check the switch setting during the driver attach and initialize the
subdevice accordingly. This allows the core to handle the validation.

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/cb_pcimdas.c