Commit 27f7f100 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: icp_multi: 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 2de13f1b
......@@ -931,7 +931,7 @@ static int icp_multi_attach(struct comedi_device *dev,
subdev = 0;
if (this_board->n_aichan) {
s = dev->subdevices + subdev;
s = &dev->subdevices[subdev];
dev->read_subdev = s;
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND;
......@@ -946,7 +946,7 @@ static int icp_multi_attach(struct comedi_device *dev,
}
if (this_board->n_aochan) {
s = dev->subdevices + subdev;
s = &dev->subdevices[subdev];
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_COMMON;
s->n_chan = this_board->n_aochan;
......@@ -959,7 +959,7 @@ static int icp_multi_attach(struct comedi_device *dev,
}
if (this_board->n_dichan) {
s = dev->subdevices + subdev;
s = &dev->subdevices[subdev];
s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE;
s->n_chan = this_board->n_dichan;
......@@ -972,7 +972,7 @@ static int icp_multi_attach(struct comedi_device *dev,
}
if (this_board->n_dochan) {
s = dev->subdevices + subdev;
s = &dev->subdevices[subdev];
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITABLE | SDF_READABLE;
s->n_chan = this_board->n_dochan;
......@@ -986,7 +986,7 @@ static int icp_multi_attach(struct comedi_device *dev,
}
if (this_board->n_ctrs) {
s = dev->subdevices + subdev;
s = &dev->subdevices[subdev];
s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_COMMON;
s->n_chan = this_board->n_ctrs;
......
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