--- zzzz-none-000/linux-2.6.19.2/drivers/scsi/fdomain.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/drivers/scsi/fdomain.c 2007-01-11 07:38:19.000000000 +0000 @@ -387,7 +387,6 @@ static int bios_major; static int bios_minor; static int PCI_bus; -static struct pci_dev *PCI_dev; static int Quantum; /* Quantum board variant */ static int interrupt_level; static volatile int in_command; @@ -813,10 +812,9 @@ PCI_DEVICE_ID_FD_36C70 ); #endif - if ((pdev = pci_get_device(PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70, pdev)) == NULL) + if ((pdev = pci_find_device(PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70, pdev)) == NULL) return 0; - if (pci_enable_device(pdev)) - goto fail; + if (pci_enable_device(pdev)) return 0; #if DEBUG_DETECT printk( "scsi: TMC-3260 detect:" @@ -833,7 +831,7 @@ pci_irq = pdev->irq; if (!request_region( pci_base, 0x10, "fdomain" )) - goto fail; + return 0; /* Now we have the I/O base address and interrupt from the PCI configuration registers. */ @@ -850,22 +848,17 @@ if (!fdomain_is_valid_port(pci_base)) { printk(KERN_ERR "scsi: PCI card detected, but driver not loaded (invalid port)\n" ); release_region(pci_base, 0x10); - goto fail; + return 0; } /* Fill in a few global variables. Ugh. */ bios_major = bios_minor = -1; PCI_bus = 1; - PCI_dev = pdev; Quantum = 0; bios_base = 0; return 1; -fail: - pci_dev_put(pdev); - return 0; } - #endif struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) @@ -916,7 +909,8 @@ if (setup_called) { printk(KERN_ERR "scsi: Bad LILO/INSMOD parameters?\n"); } - goto fail; + release_region(port_base, 0x10); + return NULL; } if (this_id) { @@ -948,7 +942,8 @@ /* Log IRQ with kernel */ if (!interrupt_level) { printk(KERN_ERR "scsi: Card Detected, but driver not loaded (no IRQ)\n" ); - goto fail; + release_region(port_base, 0x10); + return NULL; } else { /* Register the IRQ with the kernel */ @@ -969,14 +964,11 @@ printk(KERN_ERR " Send mail to faith@acm.org\n" ); } printk(KERN_ERR "scsi: Detected, but driver not loaded (IRQ)\n" ); - goto fail; + release_region(port_base, 0x10); + return NULL; } } return shpnt; -fail: - pci_dev_put(pdev); - release_region(port_base, 0x10); - return NULL; } static int fdomain_16x0_detect(struct scsi_host_template *tpnt) @@ -1722,8 +1714,6 @@ free_irq(shpnt->irq, shpnt); if (shpnt->io_port && shpnt->n_io_port) release_region(shpnt->io_port, shpnt->n_io_port); - if (PCI_bus) - pci_dev_put(PCI_dev); return 0; }