mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
staging: comedi: ni_mio_common: fix M Series ni_ai_insn_read() data mask
For NI M Series cards, the Comedi `insn_read` handler for the AI
subdevice is broken due to ANDing the value read from the AI FIFO data
register with an incorrect mask. The incorrect mask clears all but the
most significant bit of the sample data. It should preserve all the
sample data bits. Correct it.
Fixes: 817144ae7f
("staging: comedi: ni_mio_common: remove unnecessary use of 'board->adbits'")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
29f2224647
commit
655c4d442d
@ -1832,7 +1832,7 @@ static int ni_ai_insn_read(struct comedi_device *dev,
|
||||
unsigned int *data)
|
||||
{
|
||||
struct ni_private *devpriv = dev->private;
|
||||
unsigned int mask = (s->maxdata + 1) >> 1;
|
||||
unsigned int mask = s->maxdata;
|
||||
int i, n;
|
||||
unsigned int signbits;
|
||||
unsigned int d;
|
||||
|
Loading…
Reference in New Issue
Block a user