From dc63364691322014e313d1eb740df1ade2a3b13d Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 12 Jun 2013 16:17:28 -0700 Subject: [PATCH] staging: comedi: addi_apci_3xxx: remove 'iobase' from private data The private data 'iobase' is the same as the comedi_device 'iobase'. Use the one in the comedi_device instead. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- .../staging/comedi/drivers/addi_apci_3xxx.c | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c b/drivers/staging/comedi/drivers/addi_apci_3xxx.c index 39e7fb679ab8..90f974970394 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3xxx.c +++ b/drivers/staging/comedi/drivers/addi_apci_3xxx.c @@ -367,7 +367,6 @@ static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = { }; struct apci3xxx_private { - int iobase; void __iomem *dw_AiBase; unsigned int ui_AiNbrofChannels; /* how many channels is measured */ unsigned int ui_AiReadData[32]; @@ -445,9 +444,7 @@ static int apci3xxx_di_insn_bits(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct apci3xxx_private *devpriv = dev->private; - - data[1] = inl(devpriv->iobase + 32) & 0xf; + data[1] = inl(dev->iobase + 32) & 0xf; return insn->n; } @@ -457,16 +454,15 @@ static int apci3xxx_do_insn_bits(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct apci3xxx_private *devpriv = dev->private; unsigned int mask = data[0]; unsigned int bits = data[1]; - s->state = inl(devpriv->iobase + 48) & 0xf; + s->state = inl(dev->iobase + 48) & 0xf; if (mask) { s->state &= ~mask; s->state |= (bits & mask); - outl(s->state, devpriv->iobase + 48); + outl(s->state, dev->iobase + 48); } data[1] = s->state; @@ -479,7 +475,6 @@ static int apci3xxx_dio_insn_config(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct apci3xxx_private *devpriv = dev->private; unsigned int chan = CR_CHAN(insn->chanspec); unsigned int mask = 1 << chan; unsigned int bits; @@ -512,7 +507,7 @@ static int apci3xxx_dio_insn_config(struct comedi_device *dev, /* update port 2 configuration */ if (bits) - outl((s->io_bits >> 24) & 0xff, devpriv->iobase + 224); + outl((s->io_bits >> 24) & 0xff, dev->iobase + 224); return insn->n; } @@ -522,7 +517,6 @@ static int apci3xxx_dio_insn_bits(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - struct apci3xxx_private *devpriv = dev->private; unsigned int mask = data[0]; unsigned int bits = data[1]; unsigned int val; @@ -534,17 +528,17 @@ static int apci3xxx_dio_insn_bits(struct comedi_device *dev, s->state |= (bits & mask); if (mask & 0xff) - outl(s->state & 0xff, devpriv->iobase + 80); + outl(s->state & 0xff, dev->iobase + 80); if (mask & 0xff0000) - outl((s->state >> 16) & 0xff, devpriv->iobase + 112); + outl((s->state >> 16) & 0xff, dev->iobase + 112); } - val = inl(devpriv->iobase + 80); - val |= (inl(devpriv->iobase + 64) << 8); + val = inl(dev->iobase + 80); + val |= (inl(dev->iobase + 64) << 8); if (s->io_bits & 0xff0000) - val |= (inl(devpriv->iobase + 112) << 16); + val |= (inl(dev->iobase + 112) << 16); else - val |= (inl(devpriv->iobase + 96) << 16); + val |= (inl(dev->iobase + 96) << 16); data[1] = val; @@ -608,9 +602,7 @@ static int apci3xxx_auto_attach(struct comedi_device *dev, if (ret) return ret; - /* board has an ADDIDATA_9054 eeprom */ dev->iobase = pci_resource_start(pcidev, 2); - devpriv->iobase = pci_resource_start(pcidev, 2); devpriv->dw_AiBase = pci_ioremap_bar(pcidev, 3); if (pcidev->irq > 0) { -- 2.39.5