patch-2.4.0-test2 linux/drivers/scsi/qla1280.c

Next file: linux/drivers/scsi/qlogicfc.c
Previous file: linux/drivers/scsi/pci2220i.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/drivers/scsi/qla1280.c linux/drivers/scsi/qla1280.c
@@ -801,13 +801,13 @@
 	for( i=0; bdp->device_id != 0 && i < NUM_OF_ISP_DEVICES; i++, bdp++ ) {
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95)
 		while ((pdev = pci_find_device(QLA1280_VENDOR_ID,
-			bdp->device_id, pdev ) ))  
+			bdp->device_id, pdev ) ))  {
+		if (pci_enable_device(pdev)) continue;
 #else
 		while (!(pcibios_find_device(QLA1280_VENDOR_ID,
 			bdp->device_id,
-			index++, &pci_bus, &pci_devfn)) )  
+			index++, &pci_bus, &pci_devfn)) )  {
 #endif
-                {
                 /* found a adapter */
 		host = scsi_register(template, sizeof(scsi_qla_host_t));
 		ha = (scsi_qla_host_t *) host->hostdata;
@@ -817,9 +817,7 @@
 		/* Sanitize the information from PCI BIOS.  */
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95)
 		host->irq = pdev->irq;
-/* this depends on release 2.3.18 */
-		host->io_port = pdev->resource[0].start;
-/* MRS	host->io_port = (unsigned int) pdev->base_address[0]; */
+		host->io_port = pci_resource_start(pdev, 0);
 		ha->pci_bus = pdev->bus->number;
 		ha->pci_device_fn = pdev->devfn;
 		ha->pdev = pdev;
@@ -828,14 +826,13 @@
 		pcibios_read_config_dword(pci_bus, pci_devfn, OFFSET(cfgp->base_port), &piobase);
 		host->irq = pci_irq;
 		host->io_port = (unsigned int) piobase;
+		host->io_port &= PCI_BASE_ADDRESS_IO_MASK;
 		ha->pci_bus = pci_bus;
 		ha->pci_device_fn = pci_devfn;
 #endif
 		ha->device_id = bdp->device_id;
-		host->io_port &= PCI_BASE_ADDRESS_IO_MASK;
     
                 ha->devnum = i;
-                host->io_port &= PCI_BASE_ADDRESS_IO_MASK;
 		if( qla1280_mem_alloc(ha) ) {
 			printk(KERN_INFO "qla1280: Failed to allocate memory for adapter\n");
 		}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)