aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-09-05 18:39:32 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-05 20:03:55 -0700
commit4b812ac50811e8afbe2d0fd0404de02f5a2532ad (patch)
tree92e57815d3cc8676174745b4e72d52b5b1a94ce3
parent52a07cde495ccca9212b3f725b606c75e8d89a2e (diff)
staging: comedi: dt2801: remove subdevice pointer math
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>
-rw-r--r--drivers/staging/comedi/drivers/dt2801.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c
index b6481bc3b2d..c59a652a119 100644
--- a/drivers/staging/comedi/drivers/dt2801.c
+++ b/drivers/staging/comedi/drivers/dt2801.c
@@ -532,7 +532,7 @@ static int dt2801_dio_insn_bits(struct comedi_device *dev,
{
int which = 0;
- if (s == dev->subdevices + 3)
+ if (s == &dev->subdevices[3])
which = 1;
if (data[0]) {
@@ -555,7 +555,7 @@ static int dt2801_dio_insn_config(struct comedi_device *dev,
{
int which = 0;
- if (s == dev->subdevices + 3)
+ if (s == &dev->subdevices[3])
which = 1;
/* configure */
@@ -636,7 +636,7 @@ havetype:
dev->board_name = boardtype.name;
- s = dev->subdevices + 0;
+ s = &dev->subdevices[0];
/* ai subdevice */
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND;
@@ -652,7 +652,7 @@ havetype:
s->range_table = ai_range_lkup(boardtype.adrangetype, it->options[3]);
s->insn_read = dt2801_ai_insn_read;
- s++;
+ s = &dev->subdevices[1];
/* ao subdevice */
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE;
@@ -664,7 +664,7 @@ havetype:
s->insn_read = dt2801_ao_insn_read;
s->insn_write = dt2801_ao_insn_write;
- s++;
+ s = &dev->subdevices[2];
/* 1st digital subdevice */
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
@@ -674,7 +674,7 @@ havetype:
s->insn_bits = dt2801_dio_insn_bits;
s->insn_config = dt2801_dio_insn_config;
- s++;
+ s = &dev->subdevices[3];
/* 2nd digital subdevice */
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;