staging: comedi: addi_apci_3200: fix digital input 'insn_bits' function
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 6 Nov 2012 17:03:08 +0000 (10:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2012 19:21:37 +0000 (11:21 -0800)
commit7395ab3f0ad68507f59bf626017fd6ea0041bea4
tree91e953da3adfaca58adc1feac15738024e19cf63
parent9741b0ac620211d86d04c83400b08622d84347cf
staging: comedi: addi_apci_3200: fix digital input 'insn_bits' function

This driver does not follow the comedi API. The digital input 'insn_bits'
function is supposed to return the status of all the input channels in
data[1]. Currently this function uses the data[0] parameter to determine
if a single channel or all thei nput channels are being read. The status
is then being returned in data[0].

Fix the function so it works like the comedi core expects. The core can
then use the function to emulate the 'insn_read' function for individual
channels.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c
drivers/staging/comedi/drivers/addi_apci_3200.c