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

staging: comedi: addi_common: 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 6e269d7c
...@@ -1669,7 +1669,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1669,7 +1669,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
return ret; return ret;
/* Allocate and Initialise AI Subdevice Structures */ /* Allocate and Initialise AI Subdevice Structures */
s = dev->subdevices + 0; s = &dev->subdevices[0];
if ((devpriv->s_EeParameters.i_NbrAiChannel) if ((devpriv->s_EeParameters.i_NbrAiChannel)
|| (this_board->i_NbrAiChannelDiff)) { || (this_board->i_NbrAiChannelDiff)) {
dev->read_subdev = s; dev->read_subdev = s;
...@@ -1705,7 +1705,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1705,7 +1705,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
/* Allocate and Initialise AO Subdevice Structures */ /* Allocate and Initialise AO Subdevice Structures */
s = dev->subdevices + 1; s = &dev->subdevices[1];
if (devpriv->s_EeParameters.i_NbrAoChannel) { if (devpriv->s_EeParameters.i_NbrAoChannel) {
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
...@@ -1720,7 +1720,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1720,7 +1720,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
/* Allocate and Initialise DI Subdevice Structures */ /* Allocate and Initialise DI Subdevice Structures */
s = dev->subdevices + 2; s = &dev->subdevices[2];
if (devpriv->s_EeParameters.i_NbrDiChannel) { if (devpriv->s_EeParameters.i_NbrDiChannel) {
s->type = COMEDI_SUBD_DI; s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_COMMON; s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_COMMON;
...@@ -1738,7 +1738,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1738,7 +1738,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
/* Allocate and Initialise DO Subdevice Structures */ /* Allocate and Initialise DO Subdevice Structures */
s = dev->subdevices + 3; s = &dev->subdevices[3];
if (devpriv->s_EeParameters.i_NbrDoChannel) { if (devpriv->s_EeParameters.i_NbrDoChannel) {
s->type = COMEDI_SUBD_DO; s->type = COMEDI_SUBD_DO;
s->subdev_flags = s->subdev_flags =
...@@ -1760,7 +1760,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1760,7 +1760,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
/* Allocate and Initialise Timer Subdevice Structures */ /* Allocate and Initialise Timer Subdevice Structures */
s = dev->subdevices + 4; s = &dev->subdevices[4];
if (devpriv->s_EeParameters.i_Timer) { if (devpriv->s_EeParameters.i_Timer) {
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;
...@@ -1778,7 +1778,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1778,7 +1778,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
/* Allocate and Initialise TTL */ /* Allocate and Initialise TTL */
s = dev->subdevices + 5; s = &dev->subdevices[5];
if (this_board->i_NbrTTLChannel) { if (this_board->i_NbrTTLChannel) {
s->type = COMEDI_SUBD_TTLIO; s->type = COMEDI_SUBD_TTLIO;
s->subdev_flags = s->subdev_flags =
...@@ -1797,7 +1797,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1797,7 +1797,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
/* EEPROM */ /* EEPROM */
s = dev->subdevices + 6; s = &dev->subdevices[6];
if (this_board->i_PCIEeprom) { if (this_board->i_PCIEeprom) {
s->type = COMEDI_SUBD_MEMORY; s->type = COMEDI_SUBD_MEMORY;
s->subdev_flags = SDF_READABLE | SDF_INTERNAL; s->subdev_flags = SDF_READABLE | SDF_INTERNAL;
......
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