Commit 5bf4a7a7 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: amplc_pci230: 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 e11c07fe
...@@ -2838,7 +2838,7 @@ static int pci230_attach_common(struct comedi_device *dev, ...@@ -2838,7 +2838,7 @@ static int pci230_attach_common(struct comedi_device *dev,
if (rc) if (rc)
return rc; return rc;
s = dev->subdevices + 0; s = &dev->subdevices[0];
/* analog input subdevice */ /* analog input subdevice */
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND; s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND;
...@@ -2855,7 +2855,7 @@ static int pci230_attach_common(struct comedi_device *dev, ...@@ -2855,7 +2855,7 @@ static int pci230_attach_common(struct comedi_device *dev,
s->do_cmdtest = &pci230_ai_cmdtest; s->do_cmdtest = &pci230_ai_cmdtest;
s->cancel = pci230_ai_cancel; s->cancel = pci230_ai_cancel;
} }
s = dev->subdevices + 1; s = &dev->subdevices[1];
/* analog output subdevice */ /* analog output subdevice */
if (thisboard->ao_chans > 0) { if (thisboard->ao_chans > 0) {
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
...@@ -2878,7 +2878,7 @@ static int pci230_attach_common(struct comedi_device *dev, ...@@ -2878,7 +2878,7 @@ static int pci230_attach_common(struct comedi_device *dev,
} else { } else {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
s = dev->subdevices + 2; s = &dev->subdevices[2];
/* digital i/o subdevice */ /* digital i/o subdevice */
if (thisboard->have_dio) { if (thisboard->have_dio) {
rc = subdev_8255_init(dev, s, NULL, rc = subdev_8255_init(dev, s, NULL,
...@@ -2941,7 +2941,7 @@ static void pci230_detach(struct comedi_device *dev) ...@@ -2941,7 +2941,7 @@ static void pci230_detach(struct comedi_device *dev)
struct pci_dev *pcidev = comedi_to_pci_dev(dev); struct pci_dev *pcidev = comedi_to_pci_dev(dev);
if (dev->subdevices && thisboard->have_dio) if (dev->subdevices && thisboard->have_dio)
subdev_8255_cleanup(dev, dev->subdevices + 2); subdev_8255_cleanup(dev, &dev->subdevices[2]);
if (dev->irq) if (dev->irq)
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
if (pcidev) { if (pcidev) {
......
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