Commit 123c0e03 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: quatech_daqp_cs: 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 eb31b63a
...@@ -878,7 +878,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -878,7 +878,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
printk(KERN_INFO "comedi%d: attaching daqp%d (io 0x%04lx)\n", printk(KERN_INFO "comedi%d: attaching daqp%d (io 0x%04lx)\n",
dev->minor, it->options[0], dev->iobase); dev->minor, it->options[0], dev->iobase);
s = dev->subdevices + 0; s = &dev->subdevices[0];
dev->read_subdev = s; dev->read_subdev = s;
s->private = local; s->private = local;
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
...@@ -892,7 +892,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -892,7 +892,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->do_cmd = daqp_ai_cmd; s->do_cmd = daqp_ai_cmd;
s->cancel = daqp_ai_cancel; s->cancel = daqp_ai_cancel;
s = dev->subdevices + 1; s = &dev->subdevices[1];
dev->write_subdev = s; dev->write_subdev = s;
s->private = local; s->private = local;
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
...@@ -903,7 +903,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -903,7 +903,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->range_table = &range_daqp_ao; s->range_table = &range_daqp_ao;
s->insn_write = daqp_ao_insn_write; s->insn_write = daqp_ao_insn_write;
s = dev->subdevices + 2; s = &dev->subdevices[2];
s->private = local; s->private = local;
s->type = COMEDI_SUBD_DI; s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE; s->subdev_flags = SDF_READABLE;
...@@ -911,7 +911,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -911,7 +911,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->len_chanlist = 1; s->len_chanlist = 1;
s->insn_read = daqp_di_insn_read; s->insn_read = daqp_di_insn_read;
s = dev->subdevices + 3; s = &dev->subdevices[3];
s->private = local; s->private = local;
s->type = COMEDI_SUBD_DO; s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITEABLE; s->subdev_flags = SDF_WRITEABLE;
......
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