summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-09-05 18:50:39 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-05 20:06:29 -0700
commit88892ca3cebe278b4eaa8ab692d45adb1c1439fc (patch)
treee18b7ac718a6d7777da4290a536c5436270c684b
parentf9cd92eb81ea5edea0fb3d0f778a5aef35532a31 (diff)
downloadtalos-op-linux-88892ca3cebe278b4eaa8ab692d45adb1c1439fc.tar.gz
talos-op-linux-88892ca3cebe278b4eaa8ab692d45adb1c1439fc.zip
staging: comedi: ni_pcidio: 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_pcidio.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c
index 0a55de968039..a83f52517567 100644
--- a/drivers/staging/comedi/drivers/ni_pcidio.c
+++ b/drivers/staging/comedi/drivers/ni_pcidio.c
@@ -480,7 +480,7 @@ static int ni_pcidio_poll(struct comedi_device *dev, struct comedi_subdevice *s)
static irqreturn_t nidio_interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
- struct comedi_subdevice *s = dev->subdevices;
+ struct comedi_subdevice *s = &dev->subdevices[0];
struct comedi_async *async = s->async;
struct mite_struct *mite = devpriv->mite;
@@ -1252,8 +1252,8 @@ static int nidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (!this_board->is_diodaq) {
for (i = 0; i < this_board->n_8255; i++) {
- subdev_8255_init(dev, dev->subdevices + i,
- nidio96_8255_cb,
+ s = &dev->subdevices[i];
+ subdev_8255_init(dev, s, nidio96_8255_cb,
(unsigned long)(devpriv->mite->
daq_io_addr +
NIDIO_8255_BASE(i)));
@@ -1263,7 +1263,7 @@ static int nidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
printk(KERN_INFO " rev=%d",
readb(devpriv->mite->daq_io_addr + Chip_Version));
- s = dev->subdevices + 0;
+ s = &dev->subdevices[0];
dev->read_subdev = s;
s->type = COMEDI_SUBD_DIO;
@@ -1307,11 +1307,14 @@ static int nidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static void nidio_detach(struct comedi_device *dev)
{
+ struct comedi_subdevice *s;
int i;
if (this_board && !this_board->is_diodaq) {
- for (i = 0; i < this_board->n_8255; i++)
- subdev_8255_cleanup(dev, dev->subdevices + i);
+ for (i = 0; i < this_board->n_8255; i++) {
+ s = &dev->subdevices[i];
+ subdev_8255_cleanup(dev, s);
+ }
}
if (dev->irq)
free_irq(dev->irq, dev);
OpenPOWER on IntegriCloud