staging: comedi: adq12b: remove subdevice pointer math
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 6 Sep 2012 01:26:36 +0000 (18:26 -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/adq12b.c

index 6df51c8a602a2e3a90338c3b3b1ed6fc0dd447fd..0340c9ccc748c969b36b5c3a3cfaa153bb54741d 100644 (file)
@@ -272,7 +272,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       s = dev->subdevices + 0;
+       s = &dev->subdevices[0];
        /* analog input subdevice */
        s->type = COMEDI_SUBD_AI;
        if (differential) {
@@ -294,7 +294,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                                   the board can handle */
        s->insn_read = adq12b_ai_rinsn;
 
-       s = dev->subdevices + 1;
+       s = &dev->subdevices[1];
        /* digital input subdevice */
        s->type = COMEDI_SUBD_DI;
        s->subdev_flags = SDF_READABLE;
@@ -303,7 +303,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        s->range_table = &range_digital;
        s->insn_bits = adq12b_di_insn_bits;
 
-       s = dev->subdevices + 2;
+       s = &dev->subdevices[2];
        /* digital output subdevice */
        s->type = COMEDI_SUBD_DO;
        s->subdev_flags = SDF_WRITABLE;