staging: comedi: addi_apci_1500: remove private data 'iobase'
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 3 Dec 2014 18:25:36 +0000 (11:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Jan 2015 00:54:34 +0000 (16:54 -0800)
This member of the private data is the same as the comedi_device 'iobase'.
Remove the private data member and use that instead.

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

index d5d959c31043d833e143764e5a1f01f7a87cd269..ea6d98fa842f749031db2dd398cfe480a2184bbc 100644 (file)
@@ -121,13 +121,12 @@ static int i_TimerCounter1Enabled, i_TimerCounter2Enabled,
 
 static unsigned int z8536_read(struct comedi_device *dev, unsigned int reg)
 {
-       struct apci1500_private *devpriv = dev->private;
        unsigned long flags;
        unsigned int val;
 
        spin_lock_irqsave(&dev->spinlock, flags);
-       outb(reg, devpriv->iobase + APCI1500_Z8536_CTRL_REG);
-       val = inb(devpriv->iobase + APCI1500_Z8536_CTRL_REG);
+       outb(reg, dev->iobase + APCI1500_Z8536_CTRL_REG);
+       val = inb(dev->iobase + APCI1500_Z8536_CTRL_REG);
        spin_unlock_irqrestore(&dev->spinlock, flags);
 
        return val;
@@ -136,18 +135,16 @@ static unsigned int z8536_read(struct comedi_device *dev, unsigned int reg)
 static void z8536_write(struct comedi_device *dev,
                        unsigned int val, unsigned int reg)
 {
-       struct apci1500_private *devpriv = dev->private;
        unsigned long flags;
 
        spin_lock_irqsave(&dev->spinlock, flags);
-       outb(reg, devpriv->iobase + APCI1500_Z8536_CTRL_REG);
-       outb(val, devpriv->iobase + APCI1500_Z8536_CTRL_REG);
+       outb(reg, dev->iobase + APCI1500_Z8536_CTRL_REG);
+       outb(val, dev->iobase + APCI1500_Z8536_CTRL_REG);
        spin_unlock_irqrestore(&dev->spinlock, flags);
 }
 
 static void z8536_reset(struct comedi_device *dev)
 {
-       struct apci1500_private *devpriv = dev->private;
        unsigned long flags;
 
        /*
@@ -155,12 +152,12 @@ static void z8536_reset(struct comedi_device *dev)
         * sequence will reset it and put it in State 0.
         */
        spin_lock_irqsave(&dev->spinlock, flags);
-       inb(devpriv->iobase + APCI1500_Z8536_CTRL_REG);
-       outb(0, devpriv->iobase + APCI1500_Z8536_CTRL_REG);
-       inb(devpriv->iobase + APCI1500_Z8536_CTRL_REG);
-       outb(0, devpriv->iobase + APCI1500_Z8536_CTRL_REG);
-       outb(1, devpriv->iobase + APCI1500_Z8536_CTRL_REG);
-       outb(0, devpriv->iobase + APCI1500_Z8536_CTRL_REG);
+       inb(dev->iobase + APCI1500_Z8536_CTRL_REG);
+       outb(0, dev->iobase + APCI1500_Z8536_CTRL_REG);
+       inb(dev->iobase + APCI1500_Z8536_CTRL_REG);
+       outb(0, dev->iobase + APCI1500_Z8536_CTRL_REG);
+       outb(1, dev->iobase + APCI1500_Z8536_CTRL_REG);
+       outb(0, dev->iobase + APCI1500_Z8536_CTRL_REG);
        spin_unlock_irqrestore(&dev->spinlock, flags);
 
        z8536_write(dev, 0xf4, APCI1500_RW_MASTER_CONFIGURATION_CONTROL);
@@ -1541,7 +1538,7 @@ static irqreturn_t apci1500_interrupt(int irq, void *d)
                        z8536_write(dev, i_RegValue,
                                    APCI1500_RW_PORT_B_COMMAND_AND_STATUS);
                        /* Reads port B */
-                       i_RegValue = inb(devpriv->iobase +
+                       i_RegValue = inb(dev->iobase +
                                         APCI1500_Z8536_PORTB_REG);
 
                        i_RegValue = i_RegValue & 0xC0;
index 52df4959848a1e389fe81ab524930cb8e9faca46..d8a6170b2d76086dfc4e9a26e57dc77c1bb25bef 100644 (file)
@@ -8,7 +8,7 @@
 #include "amcc_s5933.h"
 
 /*
- * PCI Bar 1 Register map (devpriv->iobase)
+ * PCI Bar 1 Register map (dev->iobase)
  */
 #define APCI1500_Z8536_PORTC_REG       0x00
 #define APCI1500_Z8536_PORTB_REG       0x01
@@ -16,7 +16,6 @@
 #define APCI1500_Z8536_CTRL_REG                0x03
 
 struct apci1500_private {
-       int iobase;
        int i_IobaseAmcc;
        int i_IobaseAddon;
        int i_IobaseReserved;
@@ -43,7 +42,6 @@ static int apci1500_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);