summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-06-05 15:36:45 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-06 12:01:34 -0700
commita0e82af4c5703138b21e417440ffc937b671db1e (patch)
treef67dabac2838cf0f3bc56b5cb984fc5006e10110
parentbcc01b4d852c73dbd4cc569c905b5ab1833d00d3 (diff)
staging: comedi: pcmad: remove need for boardinfo in pcmad_ai_insn_read()
The const boardinfo pointer is only used in this function to work out the value needed to convert the data to its twos complement. Use the comedi_subdevice 'maxdata' to do this conversion and remove the 'board' pointer. 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>
-rw-r--r--drivers/staging/comedi/drivers/pcmad.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/pcmad.c b/drivers/staging/comedi/drivers/pcmad.c
index f64e75b871a7..a05b5d488f7d 100644
--- a/drivers/staging/comedi/drivers/pcmad.c
+++ b/drivers/staging/comedi/drivers/pcmad.c
@@ -88,7 +88,6 @@ static int pcmad_ai_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
- const struct pcmad_board_struct *board = comedi_board(dev);
struct pcmad_priv_struct *devpriv = dev->private;
int chan;
int n;
@@ -107,7 +106,7 @@ static int pcmad_ai_insn_read(struct comedi_device *dev,
data[n] |= (inb(dev->iobase + PCMAD_MSB) << 8);
if (devpriv->twos_comp)
- data[n] ^= (1 << (board->n_ai_bits - 1));
+ data[n] ^= ((s->maxdata + 1) >> 1);
}
return n;