// free memory
for (i = 0; i < IP2_MAX_BOARDS; i++) {
void *pB;
+#ifdef CONFIG_PCI
+ if (ip2config.type[i] == PCI && ip2config.pci_dev[i]) {
+ pci_disable_device(ip2config.pci_dev[i]);
+ ip2config.pci_dev[i] = NULL;
+ }
+#endif
if ((pB = i2BoardPtrTable[i]) != 0 ) {
kfree ( pB );
i2BoardPtrTable[i] = NULL;
PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i);
if (pci_dev_i != NULL) {
unsigned int addr;
- unsigned char pci_irq;
+ if (pci_enable_device(pci_dev_i)) {
+ printk( KERN_ERR "IP2: can't enable PCI device at %s\n",
+ pci_name(pci_dev_i));
+ break;
+ }
ip2config.type[i] = PCI;
+ ip2config.pci_dev[i] = pci_dev_i;
status =
pci_read_config_dword(pci_dev_i, PCI_BASE_ADDRESS_1, &addr);
if ( addr & 1 ) {
} else {
printk( KERN_ERR "IP2: PCI I/O address error\n");
}
- status =
- pci_read_config_byte(pci_dev_i, PCI_INTERRUPT_LINE, &pci_irq);
// If the PCI BIOS assigned it, lets try and use it. If we
// can't acquire it or it screws up, deal with it then.
// printk( KERN_ERR "IP2: Bad PCI BIOS IRQ(%d)\n",pci_irq);
// pci_irq = 0;
// }
- ip2config.irq[i] = pci_irq;
+ ip2config.irq[i] = pci_dev_i->irq;
} else { // ann error
ip2config.addr[i] = 0;
if (status == PCIBIOS_DEVICE_NOT_FOUND) {