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

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: NH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 bcc01b4d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册