提交 aac49c34 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

staging: comedi: rti800: swap val and mask when reading ai data

The (mask & val) operation when reading the high 4-bits of the analog
data looks strange. Change it to (val & mask).
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c7c1161d
......@@ -217,7 +217,7 @@ static int rti800_ai_insn_read(struct comedi_device *dev,
return ret;
data[i] = inb(dev->iobase + RTI800_ADCLO);
data[i] |= (0xf & inb(dev->iobase + RTI800_ADCHI)) << 8;
data[i] |= (inb(dev->iobase + RTI800_ADCHI) & 0xf) << 8;
if (devpriv->adc_2comp)
data[i] ^= 0x800;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册