Commit 06e915e2 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_daq_dio24: remove subdevice pointer math

Convert the comedi_subdevice access from pointer math to array
access.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fe2e334a
...@@ -164,7 +164,7 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -164,7 +164,7 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return ret; return ret;
/* 8255 dio */ /* 8255 dio */
s = dev->subdevices + 0; s = &dev->subdevices[0];
subdev_8255_init(dev, s, NULL, dev->iobase); subdev_8255_init(dev, s, NULL, dev->iobase);
return 0; return 0;
...@@ -172,8 +172,12 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -172,8 +172,12 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static void dio24_detach(struct comedi_device *dev) static void dio24_detach(struct comedi_device *dev)
{ {
if (dev->subdevices) struct comedi_subdevice *s;
subdev_8255_cleanup(dev, dev->subdevices + 0);
if (dev->subdevices) {
s = &dev->subdevices[0];
subdev_8255_cleanup(dev, s);
}
if (thisboard->bustype != pcmcia_bustype && dev->iobase) if (thisboard->bustype != pcmcia_bustype && dev->iobase)
release_region(dev->iobase, DIO24_SIZE); release_region(dev->iobase, DIO24_SIZE);
if (dev->irq) if (dev->irq)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment