/* _detach is called to deconfigure a device. It should deallocate resources. This function is also called when _attach() fails, so it should be careful not to release resources that were not necessarily allocated by _attach(). dev->private and dev->subdevices are deallocated automatically by the core.  */
static int pci1723_detach(struct comedi_device *dev)
/* _detach is called to deconfigure a device. It should deallocate resources. This function is also called when _attach() fails, so it should be careful not to release resources that were not necessarily allocated by _attach(). dev->private and dev->subdevices are deallocated automatically by the core.  */
static int pci1723_detach(struct comedi_device *dev)
{
	printk("comedi%d: pci1723: remove\n", dev->minor);
	if (dev->private) {
		if (devpriv->valid)
			pci1723_reset(dev);
		if (devpriv->pcidev) {
			if (dev->iobase) {
				comedi_pci_disable(devpriv->pcidev);
			}
			pci_dev_put(devpriv->pcidev);
		}
	}
	return 0;
}