Skip to content

Commit

Permalink
staging: comedi: amplc_pci230: remove subdevice pointer math
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 6, 2012
1 parent e11c07f commit 5bf4a7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/comedi/drivers/amplc_pci230.c
Original file line number Diff line number Diff line change
Expand Up @@ -2838,7 +2838,7 @@ static int pci230_attach_common(struct comedi_device *dev,
if (rc)
return rc;

s = dev->subdevices + 0;
s = &dev->subdevices[0];
/* analog input subdevice */
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND;
Expand All @@ -2855,7 +2855,7 @@ static int pci230_attach_common(struct comedi_device *dev,
s->do_cmdtest = &pci230_ai_cmdtest;
s->cancel = pci230_ai_cancel;
}
s = dev->subdevices + 1;
s = &dev->subdevices[1];
/* analog output subdevice */
if (thisboard->ao_chans > 0) {
s->type = COMEDI_SUBD_AO;
Expand All @@ -2878,7 +2878,7 @@ static int pci230_attach_common(struct comedi_device *dev,
} else {
s->type = COMEDI_SUBD_UNUSED;
}
s = dev->subdevices + 2;
s = &dev->subdevices[2];
/* digital i/o subdevice */
if (thisboard->have_dio) {
rc = subdev_8255_init(dev, s, NULL,
Expand Down Expand Up @@ -2941,7 +2941,7 @@ static void pci230_detach(struct comedi_device *dev)
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->subdevices && thisboard->have_dio)
subdev_8255_cleanup(dev, dev->subdevices + 2);
subdev_8255_cleanup(dev, &dev->subdevices[2]);
if (dev->irq)
free_irq(dev->irq, dev);
if (pcidev) {
Expand Down

0 comments on commit 5bf4a7a

Please sign in to comment.