diff options
author | H Hartley Sweeten | 2012-09-05 18:47:44 -0700 |
---|---|---|
committer | Greg Kroah-Hartman | 2012-09-05 20:06:28 -0700 |
commit | 41e862f3ab234349023e90bf2461977f31073a32 (patch) | |
tree | 77425bb27647ed009e2d3d02e8abf5cc959f207d | |
parent | a9c6f0bb2c06c5bdbb16c7f063811e977ce04892 (diff) |
staging: comedi: ni_660x: remove subdevice pointer math
Convert the comedi_subdevice access from pointer math to array
access.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/drivers/ni_660x.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 5e863ff343dd..6bd5b5514408 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -985,7 +985,7 @@ static irqreturn_t ni_660x_interrupt(int irq, void *d) spin_lock_irqsave(&private(dev)->interrupt_lock, flags); smp_mb(); for (i = 0; i < ni_660x_num_counters(dev); ++i) { - s = dev->subdevices + NI_660X_GPCT_SUBDEV(i); + s = &dev->subdevices[NI_660X_GPCT_SUBDEV(i)]; ni_660x_handle_gpct_interrupt(dev, s); } spin_unlock_irqrestore(&private(dev)->interrupt_lock, flags); @@ -1097,11 +1097,11 @@ static int ni_660x_attach(struct comedi_device *dev, if (ret) return ret; - s = dev->subdevices + 0; + s = &dev->subdevices[0]; /* Old GENERAL-PURPOSE COUNTER/TIME (GPCT) subdevice, no longer used */ s->type = COMEDI_SUBD_UNUSED; - s = dev->subdevices + NI_660X_DIO_SUBDEV; + s = &dev->subdevices[NI_660X_DIO_SUBDEV]; /* DIGITAL I/O SUBDEVICE */ s->type = COMEDI_SUBD_DIO; s->subdev_flags = SDF_READABLE | SDF_WRITABLE; @@ -1124,7 +1124,7 @@ static int ni_660x_attach(struct comedi_device *dev, if (private(dev)->counter_dev == NULL) return -ENOMEM; for (i = 0; i < NI_660X_MAX_NUM_COUNTERS; ++i) { - s = dev->subdevices + NI_660X_GPCT_SUBDEV(i); + s = &dev->subdevices[NI_660X_GPCT_SUBDEV(i)]; if (i < ni_660x_num_counters(dev)) { s->type = COMEDI_SUBD_COUNTER; s->subdev_flags = |