Commit 97073c05 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: s526: 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 7badc90d
...@@ -768,7 +768,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -768,7 +768,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (ret) if (ret)
return ret; return ret;
s = dev->subdevices + 0; s = &dev->subdevices[0];
/* GENERAL-PURPOSE COUNTER/TIME (GPCT) */ /* GENERAL-PURPOSE COUNTER/TIME (GPCT) */
s->type = COMEDI_SUBD_COUNTER; s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_LSAMPL; s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_LSAMPL;
...@@ -786,7 +786,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -786,7 +786,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* s->do_cmdtest = s526_gpct_cmdtest; */ /* s->do_cmdtest = s526_gpct_cmdtest; */
/* s->cancel = s526_gpct_cancel; */ /* s->cancel = s526_gpct_cancel; */
s = dev->subdevices + 1; s = &dev->subdevices[1];
/* dev->read_subdev=s; */ /* dev->read_subdev=s; */
/* analog input subdevice */ /* analog input subdevice */
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
...@@ -802,7 +802,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -802,7 +802,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->insn_read = s526_ai_rinsn; s->insn_read = s526_ai_rinsn;
s->insn_config = s526_ai_insn_config; s->insn_config = s526_ai_insn_config;
s = dev->subdevices + 2; s = &dev->subdevices[2];
/* analog output subdevice */ /* analog output subdevice */
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE; s->subdev_flags = SDF_WRITABLE;
...@@ -812,7 +812,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -812,7 +812,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->insn_write = s526_ao_winsn; s->insn_write = s526_ao_winsn;
s->insn_read = s526_ao_rinsn; s->insn_read = s526_ao_rinsn;
s = dev->subdevices + 3; s = &dev->subdevices[3];
/* digital i/o subdevice */ /* digital i/o subdevice */
if (board->have_dio) { if (board->have_dio) {
s->type = COMEDI_SUBD_DIO; s->type = COMEDI_SUBD_DIO;
......
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