Skip to content

Commit

Permalink
staging: comedi: ni_daq_dio24: remove subdevice pointer math
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 6, 2012
1 parent fe2e334 commit 06e915e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/staging/comedi/drivers/ni_daq_dio24.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,20 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return ret;

/* 8255 dio */
s = dev->subdevices + 0;
s = &dev->subdevices[0];
subdev_8255_init(dev, s, NULL, dev->iobase);

return 0;
};

static void dio24_detach(struct comedi_device *dev)
{
if (dev->subdevices)
subdev_8255_cleanup(dev, dev->subdevices + 0);
struct comedi_subdevice *s;

if (dev->subdevices) {
s = &dev->subdevices[0];
subdev_8255_cleanup(dev, s);
}
if (thisboard->bustype != pcmcia_bustype && dev->iobase)
release_region(dev->iobase, DIO24_SIZE);
if (dev->irq)
Expand Down

0 comments on commit 06e915e

Please sign in to comment.