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

staging: comedi: usbdux: 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 015ebbe8
...@@ -404,7 +404,7 @@ static void usbduxsub_ai_IsocIrq(struct urb *urb) ...@@ -404,7 +404,7 @@ static void usbduxsub_ai_IsocIrq(struct urb *urb)
/* the private structure of the subdevice is struct usbduxsub */ /* the private structure of the subdevice is struct usbduxsub */
this_usbduxsub = this_comedidev->private; this_usbduxsub = this_comedidev->private;
/* subdevice which is the AD converter */ /* subdevice which is the AD converter */
s = this_comedidev->subdevices + SUBDEV_AD; s = &this_comedidev->subdevices[SUBDEV_AD];
/* first we test if something unusual has just happened */ /* first we test if something unusual has just happened */
switch (urb->status) { switch (urb->status) {
...@@ -604,7 +604,7 @@ static void usbduxsub_ao_IsocIrq(struct urb *urb) ...@@ -604,7 +604,7 @@ static void usbduxsub_ao_IsocIrq(struct urb *urb)
/* the private structure of the subdevice is struct usbduxsub */ /* the private structure of the subdevice is struct usbduxsub */
this_usbduxsub = this_comedidev->private; this_usbduxsub = this_comedidev->private;
s = this_comedidev->subdevices + SUBDEV_DA; s = &this_comedidev->subdevices[SUBDEV_DA];
switch (urb->status) { switch (urb->status) {
case 0: case 0:
...@@ -1947,7 +1947,7 @@ static void usbduxsub_pwm_irq(struct urb *urb) ...@@ -1947,7 +1947,7 @@ static void usbduxsub_pwm_irq(struct urb *urb)
/* the private structure of the subdevice is struct usbduxsub */ /* the private structure of the subdevice is struct usbduxsub */
this_usbduxsub = this_comedidev->private; this_usbduxsub = this_comedidev->private;
s = this_comedidev->subdevices + SUBDEV_DA; s = &this_comedidev->subdevices[SUBDEV_DA];
switch (urb->status) { switch (urb->status) {
case 0: case 0:
...@@ -2331,7 +2331,7 @@ static int usbdux_attach_common(struct comedi_device *dev, ...@@ -2331,7 +2331,7 @@ static int usbdux_attach_common(struct comedi_device *dev,
dev->private = udev; dev->private = udev;
/* the first subdevice is the A/D converter */ /* the first subdevice is the A/D converter */
s = dev->subdevices + SUBDEV_AD; s = &dev->subdevices[SUBDEV_AD];
/* the URBs get the comedi subdevice */ /* the URBs get the comedi subdevice */
/* which is responsible for reading */ /* which is responsible for reading */
/* this is the subdevice which reads data */ /* this is the subdevice which reads data */
...@@ -2358,7 +2358,7 @@ static int usbdux_attach_common(struct comedi_device *dev, ...@@ -2358,7 +2358,7 @@ static int usbdux_attach_common(struct comedi_device *dev,
s->range_table = (&range_usbdux_ai_range); s->range_table = (&range_usbdux_ai_range);
/* analog out */ /* analog out */
s = dev->subdevices + SUBDEV_DA; s = &dev->subdevices[SUBDEV_DA];
/* analog out */ /* analog out */
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
/* backward pointer */ /* backward pointer */
...@@ -2384,7 +2384,7 @@ static int usbdux_attach_common(struct comedi_device *dev, ...@@ -2384,7 +2384,7 @@ static int usbdux_attach_common(struct comedi_device *dev,
s->insn_write = usbdux_ao_insn_write; s->insn_write = usbdux_ao_insn_write;
/* digital I/O */ /* digital I/O */
s = dev->subdevices + SUBDEV_DIO; s = &dev->subdevices[SUBDEV_DIO];
s->type = COMEDI_SUBD_DIO; s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE; s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = 8; s->n_chan = 8;
...@@ -2396,7 +2396,7 @@ static int usbdux_attach_common(struct comedi_device *dev, ...@@ -2396,7 +2396,7 @@ static int usbdux_attach_common(struct comedi_device *dev,
s->private = NULL; s->private = NULL;
/* counter */ /* counter */
s = dev->subdevices + SUBDEV_COUNTER; s = &dev->subdevices[SUBDEV_COUNTER];
s->type = COMEDI_SUBD_COUNTER; s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags = SDF_WRITABLE | SDF_READABLE; s->subdev_flags = SDF_WRITABLE | SDF_READABLE;
s->n_chan = 4; s->n_chan = 4;
...@@ -2407,7 +2407,7 @@ static int usbdux_attach_common(struct comedi_device *dev, ...@@ -2407,7 +2407,7 @@ static int usbdux_attach_common(struct comedi_device *dev,
if (udev->high_speed) { if (udev->high_speed) {
/* timer / pwm */ /* timer / pwm */
s = dev->subdevices + SUBDEV_PWM; s = &dev->subdevices[SUBDEV_PWM];
s->type = COMEDI_SUBD_PWM; s->type = COMEDI_SUBD_PWM;
s->subdev_flags = SDF_WRITABLE | SDF_PWM_HBRIDGE; s->subdev_flags = SDF_WRITABLE | SDF_PWM_HBRIDGE;
s->n_chan = 8; s->n_chan = 8;
......
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