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

staging: comedi: me4000: 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 bce27067
...@@ -1410,7 +1410,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id) ...@@ -1410,7 +1410,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
{ {
unsigned int tmp; unsigned int tmp;
struct comedi_device *dev = dev_id; struct comedi_device *dev = dev_id;
struct comedi_subdevice *s = dev->subdevices; struct comedi_subdevice *s = &dev->subdevices[0];
struct me4000_ai_context *ai_context = &info->ai_context; struct me4000_ai_context *ai_context = &info->ai_context;
int i; int i;
int c = 0; int c = 0;
...@@ -2017,7 +2017,7 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -2017,7 +2017,7 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
Analog input subdevice Analog input subdevice
========================================================================*/ ========================================================================*/
s = dev->subdevices + 0; s = &dev->subdevices[0];
if (thisboard->ai.count) { if (thisboard->ai.count) {
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
...@@ -2055,7 +2055,7 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -2055,7 +2055,7 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
Analog output subdevice Analog output subdevice
========================================================================*/ ========================================================================*/
s = dev->subdevices + 1; s = &dev->subdevices[1];
if (thisboard->ao.count) { if (thisboard->ao.count) {
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
...@@ -2073,7 +2073,7 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -2073,7 +2073,7 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
Digital I/O subdevice Digital I/O subdevice
========================================================================*/ ========================================================================*/
s = dev->subdevices + 2; s = &dev->subdevices[2];
if (thisboard->dio.count) { if (thisboard->dio.count) {
s->type = COMEDI_SUBD_DIO; s->type = COMEDI_SUBD_DIO;
...@@ -2100,7 +2100,7 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -2100,7 +2100,7 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
Counter subdevice Counter subdevice
========================================================================*/ ========================================================================*/
s = dev->subdevices + 3; s = &dev->subdevices[3];
if (thisboard->cnt.count) { if (thisboard->cnt.count) {
s->type = COMEDI_SUBD_COUNTER; s->type = COMEDI_SUBD_COUNTER;
......
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