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

index cad559a1a730775c1d3d1589b995f6381ac28cb7..39a2b1eed8117673423264d37cf6b11344c6fe6a 100644 (file)
@@ -804,7 +804,7 @@ static int daqboard2000_attach(struct comedi_device *dev,
 
        dev->board_name = this_board->name;
 
-       s = dev->subdevices + 0;
+       s = &dev->subdevices[0];
        /* ai subdevice */
        s->type = COMEDI_SUBD_AI;
        s->subdev_flags = SDF_READABLE | SDF_GROUND;
@@ -813,7 +813,7 @@ static int daqboard2000_attach(struct comedi_device *dev,
        s->insn_read = daqboard2000_ai_insn_read;
        s->range_table = &range_daqboard2000_ai;
 
-       s = dev->subdevices + 1;
+       s = &dev->subdevices[1];
        /* ao subdevice */
        s->type = COMEDI_SUBD_AO;
        s->subdev_flags = SDF_WRITABLE;
@@ -823,7 +823,7 @@ static int daqboard2000_attach(struct comedi_device *dev,
        s->insn_write = daqboard2000_ao_insn_write;
        s->range_table = &range_daqboard2000_ao;
 
-       s = dev->subdevices + 2;
+       s = &dev->subdevices[2];
        result = subdev_8255_init(dev, s, daqboard2000_8255_cb,
                                  (unsigned long)(devpriv->daq + 0x40));
 
@@ -836,7 +836,7 @@ static void daqboard2000_detach(struct comedi_device *dev)
        struct pci_dev *pcidev = comedi_to_pci_dev(dev);
 
        if (dev->subdevices)
-               subdev_8255_cleanup(dev, dev->subdevices + 2);
+               subdev_8255_cleanup(dev, &dev->subdevices[2]);
        if (dev->irq)
                free_irq(dev->irq, dev);
        if (devpriv) {