diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2015-11-18 10:07:06 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-12-21 15:57:40 -0800 |
commit | a1132fc1bb6914940aeaa68f32a79ca846e2090f (patch) | |
tree | ef20bb0f95040fb0660adb49a6c547fbb5440aa5 /drivers/staging/comedi | |
parent | afe5c118bd07edcb00503bd0f4ab83a6e56ae9d8 (diff) | |
download | linux-a1132fc1bb6914940aeaa68f32a79ca846e2090f.tar.bz2 |
staging: comedi: adv_pci_dio: use a const pointer to the diosubd_data
For aesthetics, use a const pointer to access the diosubd_data in the
boardinfo when doing the (*auto_attach)..
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/adv_pci_dio.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/staging/comedi/drivers/adv_pci_dio.c b/drivers/staging/comedi/drivers/adv_pci_dio.c index 4d4b38c1d0fc..5da1e623b01f 100644 --- a/drivers/staging/comedi/drivers/adv_pci_dio.c +++ b/drivers/staging/comedi/drivers/adv_pci_dio.c @@ -532,6 +532,7 @@ static int pci_dio_auto_attach(struct comedi_device *dev, { struct pci_dev *pcidev = comedi_to_pci_dev(dev); const struct dio_boardtype *board = NULL; + const struct diosubd_data *d; struct comedi_subdevice *s; int ret, subdev, i, j; @@ -555,32 +556,38 @@ static int pci_dio_auto_attach(struct comedi_device *dev, return ret; subdev = 0; - for (i = 0; i < MAX_DI_SUBDEVS; i++) - if (board->sdi[i].chans) { + for (i = 0; i < MAX_DI_SUBDEVS; i++) { + d = &board->sdi[i]; + if (d->chans) { s = &dev->subdevices[subdev++]; - pci_dio_add_di(dev, s, &board->sdi[i]); + pci_dio_add_di(dev, s, d); } + } - for (i = 0; i < MAX_DO_SUBDEVS; i++) - if (board->sdo[i].chans) { + for (i = 0; i < MAX_DO_SUBDEVS; i++) { + d = &board->sdo[i]; + if (d->chans) { s = &dev->subdevices[subdev++]; - pci_dio_add_do(dev, s, &board->sdo[i]); + pci_dio_add_do(dev, s, d); } + } - for (i = 0; i < MAX_DIO_SUBDEVG; i++) - for (j = 0; j < board->sdio[i].regs; j++) { + for (i = 0; i < MAX_DIO_SUBDEVG; i++) { + d = &board->sdio[i]; + for (j = 0; j < d->regs; j++) { s = &dev->subdevices[subdev++]; ret = subdev_8255_init(dev, s, NULL, - board->sdio[i].addr + - j * I8255_SIZE); + d->addr + j * I8255_SIZE); if (ret) return ret; } + } - if (board->boardid.chans) { + d = &board->boardid; + if (d->chans) { s = &dev->subdevices[subdev++]; s->type = COMEDI_SUBD_DI; - pci_dio_add_di(dev, s, &board->boardid); + pci_dio_add_di(dev, s, d); } if (board->timer_regbase) { |