[PATCH 016/112] staging: comedi: adq12b: remove subdevice pointer math
H Hartley Sweeten
hartleys at visionengravers.com
Thu Sep 6 01:26:36 UTC 2012
Convert the comedi_subdevice access from pointer math to array
access.
Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
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 6df51c8..0340c9c 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;
--
1.7.11
More information about the devel
mailing list