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

staging: comedi: hwdrv_APCI1710: 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 3237c964
...@@ -67,7 +67,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev) ...@@ -67,7 +67,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
return; return;
/* Allocate and Initialise Timer Subdevice Structures */ /* Allocate and Initialise Timer Subdevice Structures */
s = dev->subdevices + 0; s = &dev->subdevices[0];
s->type = COMEDI_SUBD_TIMER; s->type = COMEDI_SUBD_TIMER;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
...@@ -81,7 +81,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev) ...@@ -81,7 +81,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
s->insn_bits = i_APCI1710_InsnBitsTimer; s->insn_bits = i_APCI1710_InsnBitsTimer;
/* Allocate and Initialise DIO Subdevice Structures */ /* Allocate and Initialise DIO Subdevice Structures */
s = dev->subdevices + 1; s = &dev->subdevices[1];
s->type = COMEDI_SUBD_DIO; s->type = COMEDI_SUBD_DIO;
s->subdev_flags = s->subdev_flags =
...@@ -96,7 +96,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev) ...@@ -96,7 +96,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
s->insn_write = i_APCI1710_InsnWriteDigitalIOChlOnOff; s->insn_write = i_APCI1710_InsnWriteDigitalIOChlOnOff;
/* Allocate and Initialise Chrono Subdevice Structures */ /* Allocate and Initialise Chrono Subdevice Structures */
s = dev->subdevices + 2; s = &dev->subdevices[2];
s->type = COMEDI_SUBD_CHRONO; s->type = COMEDI_SUBD_CHRONO;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
...@@ -110,7 +110,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev) ...@@ -110,7 +110,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
s->insn_bits = i_APCI1710_InsnBitsChronoDigitalIO; s->insn_bits = i_APCI1710_InsnBitsChronoDigitalIO;
/* Allocate and Initialise PWM Subdevice Structures */ /* Allocate and Initialise PWM Subdevice Structures */
s = dev->subdevices + 3; s = &dev->subdevices[3];
s->type = COMEDI_SUBD_PWM; s->type = COMEDI_SUBD_PWM;
s->subdev_flags = s->subdev_flags =
SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON; SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
...@@ -125,7 +125,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev) ...@@ -125,7 +125,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
s->insn_bits = i_APCI1710_InsnBitsReadPWMInterrupt; s->insn_bits = i_APCI1710_InsnBitsReadPWMInterrupt;
/* Allocate and Initialise TTLIO Subdevice Structures */ /* Allocate and Initialise TTLIO Subdevice Structures */
s = dev->subdevices + 4; s = &dev->subdevices[4];
s->type = COMEDI_SUBD_TTLIO; s->type = COMEDI_SUBD_TTLIO;
s->subdev_flags = s->subdev_flags =
SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON; SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
...@@ -139,7 +139,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev) ...@@ -139,7 +139,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
s->insn_read = i_APCI1710_InsnReadTTLIOAllPortValue; s->insn_read = i_APCI1710_InsnReadTTLIOAllPortValue;
/* Allocate and Initialise TOR Subdevice Structures */ /* Allocate and Initialise TOR Subdevice Structures */
s = dev->subdevices + 5; s = &dev->subdevices[5];
s->type = COMEDI_SUBD_TOR; s->type = COMEDI_SUBD_TOR;
s->subdev_flags = s->subdev_flags =
SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON; SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
...@@ -154,7 +154,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev) ...@@ -154,7 +154,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
s->insn_bits = i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue; s->insn_bits = i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue;
/* Allocate and Initialise SSI Subdevice Structures */ /* Allocate and Initialise SSI Subdevice Structures */
s = dev->subdevices + 6; s = &dev->subdevices[6];
s->type = COMEDI_SUBD_SSI; s->type = COMEDI_SUBD_SSI;
s->subdev_flags = s->subdev_flags =
SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON; SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
...@@ -167,7 +167,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev) ...@@ -167,7 +167,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
s->insn_bits = i_APCI1710_InsnBitsSSIDigitalIO; s->insn_bits = i_APCI1710_InsnBitsSSIDigitalIO;
/* Allocate and Initialise PULSEENCODER Subdevice Structures */ /* Allocate and Initialise PULSEENCODER Subdevice Structures */
s = dev->subdevices + 7; s = &dev->subdevices[7];
s->type = COMEDI_SUBD_PULSEENCODER; s->type = COMEDI_SUBD_PULSEENCODER;
s->subdev_flags = s->subdev_flags =
SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON; SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
...@@ -181,7 +181,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev) ...@@ -181,7 +181,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
s->insn_read = i_APCI1710_InsnReadInterruptPulseEncoder; s->insn_read = i_APCI1710_InsnReadInterruptPulseEncoder;
/* Allocate and Initialise INCREMENTALCOUNTER Subdevice Structures */ /* Allocate and Initialise INCREMENTALCOUNTER Subdevice Structures */
s = dev->subdevices + 8; s = &dev->subdevices[8];
s->type = COMEDI_SUBD_INCREMENTALCOUNTER; s->type = COMEDI_SUBD_INCREMENTALCOUNTER;
s->subdev_flags = s->subdev_flags =
SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON; SDF_WRITEABLE | SDF_READABLE | SDF_GROUND | SDF_COMMON;
......
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