Skip to content

Commit

Permalink
staging: comedi: rti800: swap val and mask when reading ai data
Browse files Browse the repository at this point in the history
The (mask & val) operation when reading the high 4-bits of the analog
data looks strange. Change it to (val & mask).

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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 9, 2013
1 parent c7c1161 commit aac49c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/rti800.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aac49c3

Please sign in to comment.