staging: comedi: ii_pci20kc: remove subdevice pointer math
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 6 Sep 2012 01:44:06 +0000 (18:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Sep 2012 03:06:27 +0000 (20:06 -0700)
Convert the comedi_subdevice access from pointer math to array
access.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ii_pci20kc.c

index 0f9cfe662b9a69bf5916d02b26cb4de2670c9324..65ff1c9b973c1acd7ca9965463f0c23ae3a307f7 100644 (file)
@@ -224,7 +224,7 @@ static int pci20xxx_attach(struct comedi_device *dev,
               dev->minor, devpriv->ioaddr);
 
        for (i = 0; i < PCI20000_MODULES; i++) {
-               s = dev->subdevices + i;
+               s = &dev->subdevices[i];
                id = readb(devpriv->ioaddr + (i + 1) * PCI20000_OFFSET);
                s->private = devpriv->subdev_private + i;
                sdp = s->private;
@@ -259,7 +259,7 @@ static int pci20xxx_attach(struct comedi_device *dev,
        }
 
        /* initialize struct pci20xxx_private */
-       pci20xxx_dio_init(dev, dev->subdevices + PCI20000_MODULES);
+       pci20xxx_dio_init(dev, &dev->subdevices[PCI20000_MODULES]);
 
        return 1;
 }