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

index c253bb9ef3350af913fcbd5dfeac776d01a15b29..78dfe167b147d502ee1ee6c91b61dc22223acc57 100644 (file)
@@ -164,7 +164,7 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                return -ENOMEM;
 
        /* analog output subdevice */
-       s = dev->subdevices + 0;
+       s = &dev->subdevices[0];
        s->type = board->type;
        s->n_chan = board->n_chan;
        s->maxdata = (1 << board->n_bits) - 1;