From: David Schleef Date: Wed, 18 Jun 2003 01:25:02 +0000 (+0000) Subject: Add subdev_8255_cleanup() X-Git-Tag: r0_7_67x~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=17d2473d8716ccaf8226e1814f14ab36c7d65999;p=comedi.git Add subdev_8255_cleanup() --- diff --git a/comedi/drivers/adv_pci_dio.c b/comedi/drivers/adv_pci_dio.c index d138cf27..6944e944 100644 --- a/comedi/drivers/adv_pci_dio.c +++ b/comedi/drivers/adv_pci_dio.c @@ -1009,14 +1009,36 @@ static int pci_dio_attach(comedi_device *dev, comedi_devconfig *it) */ static int pci_dio_detach(comedi_device *dev) { - int i; + int i, j; comedi_subdevice *s; + int subdev; if (dev->private) { if (devpriv->valid) { pci_dio_reset(dev); } + /* This shows the silliness of using this kind of + * scheme for numbering subdevices. Don't do it. --ds */ + subdev = 0; + for (i=0; isdi[i].chans) { + subdev++; + } + } + for (i=0; isdo[i].chans) { + subdev++; + } + } + for (i=0; isdio[i].regs; j++) { + s = dev->subdevices + subdev; + subdev_8255_cleanup(dev, s); + subdev++; + } + } + for (i=0; in_subdevices; i++) { s=dev->subdevices+i; s->private=NULL;