From 35fcaeb87d14c2385dac6ef1520e136f288d1bd6 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 5 Sep 2012 18:44:06 -0700 Subject: [PATCH] staging: comedi: ii_pci20kc: remove subdevice pointer math Convert the comedi_subdevice access from pointer math to array access. Signed-off-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ii_pci20kc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c index 0f9cfe662b9a..65ff1c9b973c 100644 --- a/drivers/staging/comedi/drivers/ii_pci20kc.c +++ b/drivers/staging/comedi/drivers/ii_pci20kc.c @@ -224,7 +224,7 @@ static int pci20xxx_attach(struct comedi_device *dev, dev->minor, devpriv->ioaddr); for (i = 0; i < PCI20000_MODULES; i++) { - s = dev->subdevices + i; + s = &dev->subdevices[i]; id = readb(devpriv->ioaddr + (i + 1) * PCI20000_OFFSET); s->private = devpriv->subdev_private + i; sdp = s->private; @@ -259,7 +259,7 @@ static int pci20xxx_attach(struct comedi_device *dev, } /* initialize struct pci20xxx_private */ - pci20xxx_dio_init(dev, dev->subdevices + PCI20000_MODULES); + pci20xxx_dio_init(dev, &dev->subdevices[PCI20000_MODULES]); return 1; } -- 2.20.1