From 4fe92e16060e24dcf84730307e925e3b1a4302cd Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 5 Sep 2012 18:26:36 -0700 Subject: [PATCH] staging: comedi: adq12b: 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/adq12b.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/adq12b.c b/drivers/staging/comedi/drivers/adq12b.c index 6df51c8a602a..0340c9ccc748 100644 --- a/drivers/staging/comedi/drivers/adq12b.c +++ b/drivers/staging/comedi/drivers/adq12b.c @@ -272,7 +272,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it) if (ret) return ret; - s = dev->subdevices + 0; + s = &dev->subdevices[0]; /* analog input subdevice */ s->type = COMEDI_SUBD_AI; if (differential) { @@ -294,7 +294,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it) the board can handle */ s->insn_read = adq12b_ai_rinsn; - s = dev->subdevices + 1; + s = &dev->subdevices[1]; /* digital input subdevice */ s->type = COMEDI_SUBD_DI; s->subdev_flags = SDF_READABLE; @@ -303,7 +303,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->range_table = &range_digital; s->insn_bits = adq12b_di_insn_bits; - s = dev->subdevices + 2; + s = &dev->subdevices[2]; /* digital output subdevice */ s->type = COMEDI_SUBD_DO; s->subdev_flags = SDF_WRITABLE; -- 2.30.2