|
@@ -580,8 +580,8 @@ static int __devinit pc236_attach_pci(struct comedi_device *dev,
|
|
|
|
|
|
static void pc236_detach(struct comedi_device *dev)
|
|
|
{
|
|
|
+ const struct pc236_board *thisboard = comedi_board(dev);
|
|
|
struct pc236_private *devpriv = dev->private;
|
|
|
- struct pci_dev *pcidev = comedi_to_pci_dev(dev);
|
|
|
|
|
|
if (devpriv)
|
|
|
pc236_intr_disable(dev);
|
|
@@ -589,13 +589,16 @@ static void pc236_detach(struct comedi_device *dev)
|
|
|
free_irq(dev->irq, dev);
|
|
|
if (dev->subdevices)
|
|
|
subdev_8255_cleanup(dev, dev->subdevices + 0);
|
|
|
- if (pcidev) {
|
|
|
- if (dev->iobase)
|
|
|
- comedi_pci_disable(pcidev);
|
|
|
- pci_dev_put(pcidev);
|
|
|
- } else {
|
|
|
+ if (is_isa_board(thisboard)) {
|
|
|
if (dev->iobase)
|
|
|
release_region(dev->iobase, PC236_IO_SIZE);
|
|
|
+ } else if (is_pci_board(thisboard)) {
|
|
|
+ struct pci_dev *pcidev = comedi_to_pci_dev(dev);
|
|
|
+ if (pcidev) {
|
|
|
+ if (dev->iobase)
|
|
|
+ comedi_pci_disable(pcidev);
|
|
|
+ pci_dev_put(pcidev);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|