Commit 39d37be4 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: amplc_pc236: 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 6b680f90
...@@ -412,7 +412,7 @@ static int pc236_intr_cancel(struct comedi_device *dev, ...@@ -412,7 +412,7 @@ static int pc236_intr_cancel(struct comedi_device *dev,
static irqreturn_t pc236_interrupt(int irq, void *d) static irqreturn_t pc236_interrupt(int irq, void *d)
{ {
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->subdevices + 1; struct comedi_subdevice *s = &dev->subdevices[1];
int handled; int handled;
handled = pc236_intr_check(dev); handled = pc236_intr_check(dev);
...@@ -464,14 +464,14 @@ static int pc236_common_attach(struct comedi_device *dev, unsigned long iobase, ...@@ -464,14 +464,14 @@ static int pc236_common_attach(struct comedi_device *dev, unsigned long iobase,
if (ret) if (ret)
return ret; return ret;
s = dev->subdevices + 0; s = &dev->subdevices[0];
/* digital i/o subdevice (8255) */ /* digital i/o subdevice (8255) */
ret = subdev_8255_init(dev, s, NULL, iobase); ret = subdev_8255_init(dev, s, NULL, iobase);
if (ret < 0) { if (ret < 0) {
dev_err(dev->class_dev, "error! out of memory!\n"); dev_err(dev->class_dev, "error! out of memory!\n");
return ret; return ret;
} }
s = dev->subdevices + 1; s = &dev->subdevices[1];
dev->read_subdev = s; dev->read_subdev = s;
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
pc236_intr_disable(dev); pc236_intr_disable(dev);
...@@ -598,7 +598,7 @@ static void pc236_detach(struct comedi_device *dev) ...@@ -598,7 +598,7 @@ static void pc236_detach(struct comedi_device *dev)
if (dev->irq) if (dev->irq)
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
if (dev->subdevices) if (dev->subdevices)
subdev_8255_cleanup(dev, dev->subdevices + 0); subdev_8255_cleanup(dev, &dev->subdevices[0]);
if (is_isa_board(thisboard)) { if (is_isa_board(thisboard)) {
if (dev->iobase) if (dev->iobase)
release_region(dev->iobase, PC236_IO_SIZE); release_region(dev->iobase, PC236_IO_SIZE);
......
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