WSL2-Linux-Kernel/drivers/staging
Ian Abbott abe46b8932 staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channel
Reading of analog input channels by the `INSN_READ` comedi instruction
is broken for all except channel 0.  `pci171x_ai_insn_read()` calls
`pci171x_ai_read_sample()` with the wrong value for the third parameter.
It is supposed to be the current index in a channel list (which is
always of length 1 in this case, so the index should be 0), but instead
it is passing the actual channel number.  `pci171x_ai_read_sample()`
checks the channel number encoded in the raw sample value read from the
hardware matches the channel number stored in the specified index of the
previously set up channel list and returns `-ENODATA` if it doesn't
match.  Since the index should always be 0 in this case, the match will
fail unless the channel number is also 0.  Fix it by passing 0 as the
channel index.

Note that when the bug first appeared, it was `pci171x_ai_dropout()`
that was called with the wrong parameter value.  `pci171x_ai_dropout()`
got replaced with `pci171x_ai_read_sample()` in commit 7fd2dae250
("staging: comedi: adv_pci1710: introduce pci171x_ai_read_sample()").

Fixes: 16c7eb6047 ("staging: comedi: adv_pci1710: always enable PCI171x_PARANOIDCHECK code")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: stable <stable@vger.kernel.org> # 3.16+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 19:25:59 -08:00
..
android
board
clocking-wizard
comedi staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channel 2015-03-01 19:25:59 -08:00
dgap
dgnc
emxx_udc
fbtft
ft1000
fwserial
gdm72xx
gdm724x
goldfish
gs_fpgaboot
i2o
iio First round of fixes for IIO in the 4.0 cycle. Note a followup 2015-02-28 07:15:09 -08:00
lustre
media
mt29f_spinand
netlogic
nvec
octeon
octeon-usb
olpc_dcon
ozwpan
panel
rtl8188eu
rtl8192e
rtl8192u
rtl8712
rtl8723au
rts5208
skein
slicoss
sm7xxfb
speakup
ste_rmi4
unisys
vme
vt6655
vt6656
wlan-ng
xgifb
Kconfig
Makefile
staging.c