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

index 67233be8c7d66a57a10b7b08f0c7849b99c8809c..96cfc9cd4a30a98e0e94e18710c5c12598088a29 100644 (file)
@@ -121,7 +121,7 @@ static int adl_pci7296_attach_pci(struct comedi_device *dev,
                return ret;
 
        for (i = 0; i < board->nsubdevs; i++) {
-               s = dev->subdevices + i;
+               s = &dev->subdevices[i];
                ret = subdev_8255_init(dev, s, NULL, dev->iobase + (i * 4));
                if (ret)
                        return ret;
@@ -142,7 +142,7 @@ static void adl_pci7296_detach(struct comedi_device *dev)
 
        if (dev->subdevices) {
                for (i = 0; i < board->nsubdevs; i++) {
-                       s = dev->subdevices + i;
+                       s = &dev->subdevices[i];
                        subdev_8255_cleanup(dev, s);
                }
        }