From: H Hartley Sweeten Date: Thu, 6 Sep 2012 01:30:47 +0000 (-0700) Subject: staging: comedi: amplc_pci230: remove subdevice pointer math X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5bf4a7a7081204eca004e04b0da726513f49142c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: amplc_pci230: 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 --- diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c index 66e74bd12267..4c9f1314ea1d 100644 --- a/drivers/staging/comedi/drivers/amplc_pci230.c +++ b/drivers/staging/comedi/drivers/amplc_pci230.c @@ -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; @@ -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; @@ -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, @@ -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) {