[PATCH 09/23] staging: comedi: addi_apci_2200: 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>
---
 .../comedi/drivers/addi-data/hwdrv_apci2200.c      | 48 ++++++++--------------
 drivers/staging/comedi/drivers/addi_apci_2200.c    | 11 ++---
 2 files changed, 21 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c
index e4a422e..3217203 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c
@@ -65,9 +65,7 @@ static int apci2200_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 + APCI2200_DIGITAL_IP);
+	data[1] = inw(dev->iobase + APCI2200_DIGITAL_IP);
 
 	return insn->n;
 }
@@ -77,16 +75,15 @@ static int apci2200_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 + APCI2200_DIGITAL_OP);
+	s->state = inw(dev->iobase + APCI2200_DIGITAL_OP);
 	if (mask) {
 		s->state &= ~mask;
 		s->state |= (bits & mask);
 
-		outw(s->state, devpriv->iobase + APCI2200_DIGITAL_OP);
+		outw(s->state, dev->iobase + APCI2200_DIGITAL_OP);
 	}
 
 	data[1] = s->state;
@@ -120,21 +117,16 @@ static int i_APCI2200_ConfigWatchdog(struct comedi_device *dev,
 				     struct comedi_insn *insn,
 				     unsigned int *data)
 {
-	struct addi_private *devpriv = dev->private;
-
 	if (data[0] == 0) {
 		/* Disable the watchdog */
-		outw(0x0,
-			devpriv->iobase + APCI2200_WATCHDOG +
-			APCI2200_WATCHDOG_ENABLEDISABLE);
+		outw(0x0, dev->iobase + APCI2200_WATCHDOG +
+				APCI2200_WATCHDOG_ENABLEDISABLE);
 		/* Loading the Reload value */
-		outw(data[1],
-			devpriv->iobase + APCI2200_WATCHDOG +
-			APCI2200_WATCHDOG_RELOAD_VALUE);
+		outw(data[1], dev->iobase + APCI2200_WATCHDOG +
+				APCI2200_WATCHDOG_RELOAD_VALUE);
 		data[1] = data[1] >> 16;
-		outw(data[1],
-			devpriv->iobase + APCI2200_WATCHDOG +
-			APCI2200_WATCHDOG_RELOAD_VALUE + 2);
+		outw(data[1], dev->iobase + APCI2200_WATCHDOG +
+				APCI2200_WATCHDOG_RELOAD_VALUE + 2);
 	}			/* if(data[0]==0) */
 	else {
 		printk("\nThe input parameters are wrong\n");
@@ -170,21 +162,18 @@ static int i_APCI2200_StartStopWriteWatchdog(struct comedi_device *dev,
 					     struct comedi_insn *insn,
 					     unsigned int *data)
 {
-	struct addi_private *devpriv = dev->private;
-
 	switch (data[0]) {
 	case 0:		/* stop the watchdog */
-		outw(0x0, devpriv->iobase + APCI2200_WATCHDOG + APCI2200_WATCHDOG_ENABLEDISABLE);	/* disable the watchdog */
+		outw(0x0, dev->iobase + APCI2200_WATCHDOG +
+				APCI2200_WATCHDOG_ENABLEDISABLE);
 		break;
 	case 1:		/* start the watchdog */
-		outw(0x0001,
-			devpriv->iobase + APCI2200_WATCHDOG +
-			APCI2200_WATCHDOG_ENABLEDISABLE);
+		outw(0x0001, dev->iobase + APCI2200_WATCHDOG +
+				APCI2200_WATCHDOG_ENABLEDISABLE);
 		break;
 	case 2:		/* Software trigger */
-		outw(0x0201,
-			devpriv->iobase + APCI2200_WATCHDOG +
-			APCI2200_WATCHDOG_ENABLEDISABLE);
+		outw(0x0201, dev->iobase + APCI2200_WATCHDOG +
+				APCI2200_WATCHDOG_ENABLEDISABLE);
 		break;
 	default:
 		printk("\nSpecified functionality does not exist\n");
@@ -219,10 +208,7 @@ static int i_APCI2200_ReadWatchdog(struct comedi_device *dev,
 				   struct comedi_insn *insn,
 				   unsigned int *data)
 {
-	struct addi_private *devpriv = dev->private;
-
-	data[0] =
-		inw(devpriv->iobase + APCI2200_WATCHDOG +
-		APCI2200_WATCHDOG_STATUS) & 0x1;
+	data[0] = inw(dev->iobase + APCI2200_WATCHDOG +
+			APCI2200_WATCHDOG_STATUS) & 0x1;
 	return insn->n;
 }
diff --git a/drivers/staging/comedi/drivers/addi_apci_2200.c b/drivers/staging/comedi/drivers/addi_apci_2200.c
index 1205fe9..cd1ac41 100644
--- a/drivers/staging/comedi/drivers/addi_apci_2200.c
+++ b/drivers/staging/comedi/drivers/addi_apci_2200.c
@@ -32,14 +32,12 @@ static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
 
 static int apci2200_reset(struct comedi_device *dev)
 {
-	struct addi_private *devpriv = dev->private;
-
-	outw(0x0, devpriv->iobase + APCI2200_DIGITAL_OP);
-	outw(0x0, devpriv->iobase + APCI2200_WATCHDOG +
+	outw(0x0, dev->iobase + APCI2200_DIGITAL_OP);
+	outw(0x0, dev->iobase + APCI2200_WATCHDOG +
 			APCI2200_WATCHDOG_ENABLEDISABLE);
-	outw(0x0, devpriv->iobase + APCI2200_WATCHDOG +
+	outw(0x0, dev->iobase + APCI2200_WATCHDOG +
 			APCI2200_WATCHDOG_RELOAD_VALUE);
-	outw(0x0, devpriv->iobase + APCI2200_WATCHDOG +
+	outw(0x0, dev->iobase + APCI2200_WATCHDOG +
 			APCI2200_WATCHDOG_RELOAD_VALUE + 2);
 
 	return 0;
@@ -87,7 +85,6 @@ static int apci2200_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.8.0

_______________________________________________
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