Commit 2e3d3cf5 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: das1800: 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 9b7beb66
...@@ -656,7 +656,7 @@ static int das1800_cancel(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -656,7 +656,7 @@ static int das1800_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
/* the guts of the interrupt handler, that is shared with das1800_ai_poll */ /* the guts of the interrupt handler, that is shared with das1800_ai_poll */
static void das1800_ai_handler(struct comedi_device *dev) static void das1800_ai_handler(struct comedi_device *dev)
{ {
struct comedi_subdevice *s = dev->subdevices + 0; /* analog input subdevice */ struct comedi_subdevice *s = &dev->subdevices[0];
struct comedi_async *async = s->async; struct comedi_async *async = s->async;
struct comedi_cmd *cmd = &async->cmd; struct comedi_cmd *cmd = &async->cmd;
unsigned int status = inb(dev->iobase + DAS1800_STATUS); unsigned int status = inb(dev->iobase + DAS1800_STATUS);
...@@ -1653,7 +1653,7 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1653,7 +1653,7 @@ static int das1800_attach(struct comedi_device *dev,
return retval; return retval;
/* analog input subdevice */ /* analog input subdevice */
s = dev->subdevices + 0; s = &dev->subdevices[0];
dev->read_subdev = s; dev->read_subdev = s;
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND | SDF_CMD_READ; s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND | SDF_CMD_READ;
...@@ -1670,7 +1670,7 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1670,7 +1670,7 @@ static int das1800_attach(struct comedi_device *dev,
s->cancel = das1800_cancel; s->cancel = das1800_cancel;
/* analog out */ /* analog out */
s = dev->subdevices + 1; s = &dev->subdevices[1];
if (thisboard->ao_ability == 1) { if (thisboard->ao_ability == 1) {
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE; s->subdev_flags = SDF_WRITABLE;
...@@ -1683,7 +1683,7 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1683,7 +1683,7 @@ static int das1800_attach(struct comedi_device *dev,
} }
/* di */ /* di */
s = dev->subdevices + 2; s = &dev->subdevices[2];
s->type = COMEDI_SUBD_DI; s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE; s->subdev_flags = SDF_READABLE;
s->n_chan = 4; s->n_chan = 4;
...@@ -1692,7 +1692,7 @@ static int das1800_attach(struct comedi_device *dev, ...@@ -1692,7 +1692,7 @@ static int das1800_attach(struct comedi_device *dev,
s->insn_bits = das1800_di_rbits; s->insn_bits = das1800_di_rbits;
/* do */ /* do */
s = dev->subdevices + 3; s = &dev->subdevices[3];
s->type = COMEDI_SUBD_DO; s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITABLE | SDF_READABLE; s->subdev_flags = SDF_WRITABLE | SDF_READABLE;
s->n_chan = thisboard->do_n_chan; s->n_chan = thisboard->do_n_chan;
......
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