[PATCH 18/41] staging: comedi: addi_apci_1516: remove devpriv->iobase usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The iobase address stored in devpriv->iobase is also stored in dev->iobase.
Use that instead.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c | 10 +++-------
 drivers/staging/comedi/drivers/addi_apci_1516.c           |  3 +--
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c
index 9aa8298..0658fe9 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c
@@ -75,9 +75,7 @@ static int apci1516_di_insn_bits(struct comedi_device *dev,
 				 struct comedi_insn *insn,
 				 unsigned int *data)
 {
-	struct addi_private *devpriv = dev->private;
-
-	data[1] = inw(devpriv->iobase + APCI1516_DI_REG);
+	data[1] = inw(dev->iobase + APCI1516_DI_REG);
 
 	return insn->n;
 }
@@ -87,17 +85,15 @@ static int apci1516_do_insn_bits(struct comedi_device *dev,
 				 struct comedi_insn *insn,
 				 unsigned int *data)
 {
-
-	struct addi_private *devpriv = dev->private;
 	unsigned int mask = data[0];
 	unsigned int bits = data[1];
 
-	s->state = inw(devpriv->iobase + APCI1516_DO_REG);
+	s->state = inw(dev->iobase + APCI1516_DO_REG);
 	if (mask) {
 		s->state &= ~mask;
 		s->state |= (bits & mask);
 
-		outw(s->state, devpriv->iobase + APCI1516_DO_REG);
+		outw(s->state, dev->iobase + APCI1516_DO_REG);
 	}
 
 	data[1] = s->state;
diff --git a/drivers/staging/comedi/drivers/addi_apci_1516.c b/drivers/staging/comedi/drivers/addi_apci_1516.c
index 6c61f3d..dabf44c 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1516.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1516.c
@@ -35,7 +35,7 @@ static int apci1516_reset(struct comedi_device *dev)
 	if (!this_board->i_Timer)
 		return 0;
 
-	outw(0x0, devpriv->iobase + APCI1516_DO_REG);
+	outw(0x0, dev->iobase + APCI1516_DO_REG);
 	outw(0x0, devpriv->i_IobaseAddon + APCI1516_WDOG_CTRL_REG);
 	outw(0x0, devpriv->i_IobaseAddon + APCI1516_WDOG_RELOAD_LSB_REG);
 	outw(0x0, devpriv->i_IobaseAddon + APCI1516_WDOG_RELOAD_MSB_REG);
@@ -85,7 +85,6 @@ static int __devinit apci1516_auto_attach(struct comedi_device *dev,
 		return ret;
 
 	dev->iobase = pci_resource_start(pcidev, 1);
-	devpriv->iobase = dev->iobase;
 	devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0);
 	devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2);
 	devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);
-- 
1.7.11

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux