staging: comedi: cb_pcidio: remove subdevice pointer math
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 6 Sep 2012 01:32:42 +0000 (18:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Sep 2012 03:03:53 +0000 (20:03 -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/cb_pcidio.c

index 52c63794a39e084e1e976d81fd6b8279aba376f6..9f406efdd7073afd64d55041b9c9cb0dc4c2051c 100644 (file)
@@ -119,7 +119,7 @@ static int pcidio_attach_pci(struct comedi_device *dev,
                return ret;
 
        for (i = 0; i < board->n_8255; i++) {
-               s = dev->subdevices + i;
+               s = &dev->subdevices[i];
                ret = subdev_8255_init(dev, s, NULL, dev->iobase + i * 4);
                if (ret)
                        return ret;
@@ -140,7 +140,7 @@ static void pcidio_detach(struct comedi_device *dev)
 
        if (dev->subdevices) {
                for (i = 0; i < board->n_8255; i++) {
-                       s = dev->subdevices + i;
+                       s = &dev->subdevices[i];
                        subdev_8255_cleanup(dev, s);
                }
        }