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

index 62c8c44a8d286f5f1577db319562d3c28d86444d..93938cec93e789043a07f59c31e5aea9beac167f 100644 (file)
@@ -358,7 +358,7 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       s = dev->subdevices + 0;
+       s = &dev->subdevices[0];
        /* analog output subdevice */
        s->type = COMEDI_SUBD_AO;
        s->subdev_flags = SDF_WRITABLE;
@@ -371,7 +371,7 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        s->insn_write = &atao_ao_winsn;
        s->insn_read = &atao_ao_rinsn;
 
-       s = dev->subdevices + 1;
+       s = &dev->subdevices[1];
        /* digital i/o subdevice */
        s->type = COMEDI_SUBD_DIO;
        s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
@@ -381,7 +381,7 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        s->insn_bits = atao_dio_insn_bits;
        s->insn_config = atao_dio_insn_config;
 
-       s = dev->subdevices + 2;
+       s = &dev->subdevices[2];
        /* caldac subdevice */
        s->type = COMEDI_SUBD_CALIB;
        s->subdev_flags = SDF_WRITABLE | SDF_INTERNAL;
@@ -390,7 +390,7 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        s->insn_read = atao_calib_insn_read;
        s->insn_write = atao_calib_insn_write;
 
-       s = dev->subdevices + 3;
+       s = &dev->subdevices[3];
        /* eeprom subdevice */
        /* s->type=COMEDI_SUBD_EEPROM; */
        s->type = COMEDI_SUBD_UNUSED;