summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-09-05 18:55:08 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-05 20:06:31 -0700
commit68720ae68a94444387d56bc5a166396e33e420a5 (patch)
tree0e249c8df92d3c8b4ed025cc113f60ca6f43478e
parent33e101ad9d6f8d23fb67d92081e8c2a5b695d83c (diff)
downloadop-kernel-dev-68720ae68a94444387d56bc5a166396e33e420a5.zip
op-kernel-dev-68720ae68a94444387d56bc5a166396e33e420a5.tar.gz
staging: comedi: pcmuio: 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/pcmuio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c
index feef3d0..aba6b45 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -456,6 +456,7 @@ static irqreturn_t interrupt_pcmuio(int irq, void *d)
{
int asic, got1 = 0;
struct comedi_device *dev = (struct comedi_device *)d;
+ int i;
for (asic = 0; asic < MAX_ASICS; ++asic) {
if (irq == devpriv->asics[asic].irq) {
@@ -507,9 +508,8 @@ static irqreturn_t interrupt_pcmuio(int irq, void *d)
printk
("PCMUIO DEBUG: got edge detect interrupt %d asic %d which_chans: %06x\n",
irq, asic, triggered);
- for (s = dev->subdevices;
- s < dev->subdevices + dev->n_subdevices;
- ++s) {
+ for (i = 0; i < dev->n_subdevices; i++) {
+ s = &dev->subdevices[i];
if (subpriv->intr.asic == asic) { /* this is an interrupt subdev, and it matches this asic! */
unsigned long flags;
unsigned oldevents;
@@ -811,8 +811,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
for (sdev_no = 0; sdev_no < (int)dev->n_subdevices; ++sdev_no) {
int byte_no;
- s = dev->subdevices + sdev_no;
- s->private = devpriv->sprivs + sdev_no;
+ s = &dev->subdevices[sdev_no];
+ s->private = &devpriv->sprivs[sdev_no];
s->maxdata = 1;
s->range_table = &range_digital;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
OpenPOWER on IntegriCloud