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

staging: comedi: vmk80xx: 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 ae449821
...@@ -1119,7 +1119,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev, ...@@ -1119,7 +1119,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev,
return ret; return ret;
} }
/* Analog input subdevice */ /* Analog input subdevice */
s = cdev->subdevices + VMK80XX_SUBD_AI; s = &cdev->subdevices[VMK80XX_SUBD_AI];
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND; s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = dev->board.ai_chans; s->n_chan = dev->board.ai_chans;
...@@ -1127,7 +1127,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev, ...@@ -1127,7 +1127,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev,
s->range_table = dev->board.range; s->range_table = dev->board.range;
s->insn_read = vmk80xx_ai_rinsn; s->insn_read = vmk80xx_ai_rinsn;
/* Analog output subdevice */ /* Analog output subdevice */
s = cdev->subdevices + VMK80XX_SUBD_AO; s = &cdev->subdevices[VMK80XX_SUBD_AO];
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND;
s->n_chan = dev->board.ao_chans; s->n_chan = dev->board.ao_chans;
...@@ -1139,7 +1139,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev, ...@@ -1139,7 +1139,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev,
s->insn_read = vmk80xx_ao_rinsn; s->insn_read = vmk80xx_ao_rinsn;
} }
/* Digital input subdevice */ /* Digital input subdevice */
s = cdev->subdevices + VMK80XX_SUBD_DI; s = &cdev->subdevices[VMK80XX_SUBD_DI];
s->type = COMEDI_SUBD_DI; s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE | SDF_GROUND; s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = dev->board.di_chans; s->n_chan = dev->board.di_chans;
...@@ -1147,7 +1147,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev, ...@@ -1147,7 +1147,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev,
s->insn_read = vmk80xx_di_rinsn; s->insn_read = vmk80xx_di_rinsn;
s->insn_bits = vmk80xx_di_bits; s->insn_bits = vmk80xx_di_bits;
/* Digital output subdevice */ /* Digital output subdevice */
s = cdev->subdevices + VMK80XX_SUBD_DO; s = &cdev->subdevices[VMK80XX_SUBD_DO];
s->type = COMEDI_SUBD_DO; s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND;
s->n_chan = dev->board.do_chans; s->n_chan = dev->board.do_chans;
...@@ -1159,7 +1159,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev, ...@@ -1159,7 +1159,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev,
s->insn_read = vmk80xx_do_rinsn; s->insn_read = vmk80xx_do_rinsn;
} }
/* Counter subdevice */ /* Counter subdevice */
s = cdev->subdevices + VMK80XX_SUBD_CNT; s = &cdev->subdevices[VMK80XX_SUBD_CNT];
s->type = COMEDI_SUBD_COUNTER; s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags = SDF_READABLE; s->subdev_flags = SDF_READABLE;
s->n_chan = dev->board.cnt_chans; s->n_chan = dev->board.cnt_chans;
...@@ -1172,7 +1172,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev, ...@@ -1172,7 +1172,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev,
} }
/* PWM subdevice */ /* PWM subdevice */
if (dev->board.model == VMK8061_MODEL) { if (dev->board.model == VMK8061_MODEL) {
s = cdev->subdevices + VMK80XX_SUBD_PWM; s = &cdev->subdevices[VMK80XX_SUBD_PWM];
s->type = COMEDI_SUBD_PWM; s->type = COMEDI_SUBD_PWM;
s->subdev_flags = SDF_READABLE | SDF_WRITEABLE; s->subdev_flags = SDF_READABLE | SDF_WRITEABLE;
s->n_chan = dev->board.pwm_chans; s->n_chan = dev->board.pwm_chans;
......
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