diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-09-05 18:35:24 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-05 20:03:54 -0700 |
commit | 2add117c2fcbfe9821dd9c97bf76610ed186e767 (patch) | |
tree | dd5a4bbbe088fa0e12185f23c3dcfe3a02a204bf | |
parent | b81535777699f6970b10cc16d51fb6f1b96c259e (diff) |
staging: comedi: das08: remove subdevice pointer math
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>
-rw-r--r-- | drivers/staging/comedi/drivers/das08.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c index 0c69b05fceb..5fd21fa6c1c 100644 --- a/drivers/staging/comedi/drivers/das08.c +++ b/drivers/staging/comedi/drivers/das08.c @@ -670,7 +670,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) if (ret) return ret; - s = dev->subdevices + 0; + s = &dev->subdevices[0]; /* ai */ if (thisboard->ai_nbits) { s->type = COMEDI_SUBD_AI; @@ -689,7 +689,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) s->type = COMEDI_SUBD_UNUSED; } - s = dev->subdevices + 1; + s = &dev->subdevices[1]; /* ao */ if (thisboard->ao_nbits) { s->type = COMEDI_SUBD_AO; @@ -704,7 +704,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) s->type = COMEDI_SUBD_UNUSED; } - s = dev->subdevices + 2; + s = &dev->subdevices[2]; /* di */ if (thisboard->di_nchan) { s->type = COMEDI_SUBD_DI; @@ -718,7 +718,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) s->type = COMEDI_SUBD_UNUSED; } - s = dev->subdevices + 3; + s = &dev->subdevices[3]; /* do */ if (thisboard->do_nchan) { s->type = COMEDI_SUBD_DO; @@ -732,7 +732,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) s->type = COMEDI_SUBD_UNUSED; } - s = dev->subdevices + 4; + s = &dev->subdevices[4]; /* 8255 */ if (thisboard->i8255_offset != 0) { subdev_8255_init(dev, s, NULL, (unsigned long)(dev->iobase + @@ -742,7 +742,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase) s->type = COMEDI_SUBD_UNUSED; } - s = dev->subdevices + 5; + s = &dev->subdevices[5]; /* 8254 */ if (thisboard->i8254_offset != 0) { s->type = COMEDI_SUBD_COUNTER; @@ -838,7 +838,7 @@ das08_attach(struct comedi_device *dev, struct comedi_devconfig *it) void das08_common_detach(struct comedi_device *dev) { if (dev->subdevices) - subdev_8255_cleanup(dev, dev->subdevices + 4); + subdev_8255_cleanup(dev, &dev->subdevices[4]); } EXPORT_SYMBOL_GPL(das08_common_detach); |