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

staging: comedi: adv_pci_dio: clarify subdevice index in pci1760_attach()

The subdevice index numbers are fixed when attaching to a pci1710 card.
Remove the subdev variable and just open code the array index numbers.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2b36ab6c
......@@ -955,9 +955,8 @@ static int pci_dio_reset(struct comedi_device *dev)
static int pci1760_attach(struct comedi_device *dev)
{
struct comedi_subdevice *s;
int subdev = 0;
s = &dev->subdevices[subdev];
s = &dev->subdevices[0];
s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_COMMON;
s->n_chan = 8;
......@@ -965,9 +964,8 @@ static int pci1760_attach(struct comedi_device *dev)
s->len_chanlist = 8;
s->range_table = &range_digital;
s->insn_bits = pci1760_insn_bits_di;
subdev++;
s = &dev->subdevices[subdev];
s = &dev->subdevices[1];
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_COMMON;
s->n_chan = 8;
......@@ -976,18 +974,16 @@ static int pci1760_attach(struct comedi_device *dev)
s->range_table = &range_digital;
s->state = 0;
s->insn_bits = pci1760_insn_bits_do;
subdev++;
s = &dev->subdevices[subdev];
s = &dev->subdevices[2];
s->type = COMEDI_SUBD_TIMER;
s->subdev_flags = SDF_WRITABLE | SDF_LSAMPL;
s->n_chan = 2;
s->maxdata = 0xffffffff;
s->len_chanlist = 2;
/* s->insn_config=pci1760_insn_pwm_cfg; */
subdev++;
s = &dev->subdevices[subdev];
s = &dev->subdevices[3];
s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = 8;
......@@ -996,7 +992,6 @@ static int pci1760_attach(struct comedi_device *dev)
s->insn_read = pci1760_insn_cnt_read;
s->insn_write = pci1760_insn_cnt_write;
/* s->insn_config=pci1760_insn_cnt_cfg; */
subdev++;
return 0;
}
......
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