mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-23 22:25:40 +08:00
staging: comedi: adl_pci9111: remove subdevice pointer math
Convert the comedi_subdevice access from pointer math to array access. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d1d7b20def
commit
573e31af7c
@ -1322,7 +1322,7 @@ static int pci9111_attach(struct comedi_device *dev,
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
s = dev->subdevices + 0;
|
||||
s = &dev->subdevices[0];
|
||||
dev->read_subdev = s;
|
||||
|
||||
s->type = COMEDI_SUBD_AI;
|
||||
@ -1342,7 +1342,7 @@ static int pci9111_attach(struct comedi_device *dev,
|
||||
s->do_cmd = pci9111_ai_do_cmd;
|
||||
s->munge = pci9111_ai_munge;
|
||||
|
||||
s = dev->subdevices + 1;
|
||||
s = &dev->subdevices[1];
|
||||
s->type = COMEDI_SUBD_AO;
|
||||
s->subdev_flags = SDF_WRITABLE | SDF_COMMON;
|
||||
s->n_chan = board->ao_channel_nbr;
|
||||
@ -1352,7 +1352,7 @@ static int pci9111_attach(struct comedi_device *dev,
|
||||
s->insn_write = pci9111_ao_insn_write;
|
||||
s->insn_read = pci9111_ao_insn_read;
|
||||
|
||||
s = dev->subdevices + 2;
|
||||
s = &dev->subdevices[2];
|
||||
s->type = COMEDI_SUBD_DI;
|
||||
s->subdev_flags = SDF_READABLE;
|
||||
s->n_chan = PCI9111_DI_CHANNEL_NBR;
|
||||
@ -1360,7 +1360,7 @@ static int pci9111_attach(struct comedi_device *dev,
|
||||
s->range_table = &range_digital;
|
||||
s->insn_bits = pci9111_di_insn_bits;
|
||||
|
||||
s = dev->subdevices + 3;
|
||||
s = &dev->subdevices[3];
|
||||
s->type = COMEDI_SUBD_DO;
|
||||
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
|
||||
s->n_chan = PCI9111_DO_CHANNEL_NBR;
|
||||
|
Loading…
Reference in New Issue
Block a user