Commit a81f87e9 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: pcmmio: remove 'iobase' from subdevice private data

The 'iobase' is only used to pass the iobase address of the analog output
registers to ao_winsn(). This address is simply dev->iobase + 8.

Use that instead and remove the 'iobase' from the subdevice private data.
This removes a couple more uses of the ugly 'subpriv' macro.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e83d5f26
......@@ -191,9 +191,6 @@ struct pcmmio_subdev_private {
/* for DIO: mapping of halfwords (bytes)
in port/chanarray to iobase */
unsigned long iobases[PORTS_PER_SUBDEV];
/* for AI/AO */
unsigned long iobase;
};
union {
struct {
......@@ -887,8 +884,9 @@ static int ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct pcmmio_private *devpriv = dev->private;
unsigned long iobase = dev->iobase + 8;
unsigned int iooffset = 0;
int n;
unsigned iobase = subpriv->iobase, iooffset = 0;
for (n = 0; n < insn->n; n++) {
unsigned chan = CR_CHAN(insn->chanspec), range =
......@@ -991,7 +989,6 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* Next, AO */
s = &dev->subdevices[1];
s->private = &devpriv->sprivs[1];
s->maxdata = 0xffff;
s->range_table = &pcmmio_ao_ranges;
s->subdev_flags = SDF_READABLE;
......@@ -1000,10 +997,10 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->len_chanlist = s->n_chan;
s->insn_read = ao_rinsn;
s->insn_write = ao_winsn;
subpriv->iobase = dev->iobase + 8;
/* initialize the resource enable register by clearing it */
outb(0, subpriv->iobase + 3);
outb(0, subpriv->iobase + 4 + 3);
outb(0, dev->iobase + 8 + 3);
outb(0, dev->iobase + 8 + 4 + 3);
port = 0;
asic = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment