staging: comedi: addi_apci_2200: remove devpriv->iobase usage
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 18 Jan 2013 00:38:44 +0000 (17:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jan 2013 20:49:24 +0000 (12:49 -0800)
The iobase address stored in devpriv->iobase is also stored in
dev->iobase. Use that instead.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c
drivers/staging/comedi/drivers/addi_apci_2200.c

index e4a422e..3217203 100644 (file)
@@ -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;
 }
index 1205fe9..cd1ac41 100644 (file)
@@ -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);