patch-2.3.16 linux/drivers/scsi/qlogicisp.c

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

diff -u --recursive --new-file v2.3.15/linux/drivers/scsi/qlogicisp.c linux/drivers/scsi/qlogicisp.c
@@ -1170,7 +1170,7 @@
 
 static int isp1020_init(struct Scsi_Host *sh)
 {
-	u_long io_base;
+	u_long io_base, io_flags;
 	struct isp1020_hostdata *hostdata;
 	u_char revision;
 	u_int irq;
@@ -1188,7 +1188,9 @@
 		printk("qlogicisp : error reading PCI configuration\n");
 		return 1;
 	}
+
 	io_base = pdev->resource[0].start;
+	io_flags = pdev->resource[0].flags;
 	irq = pdev->irq;
 
 	if (pdev->vendor != PCI_VENDOR_ID_QLOGIC) {
@@ -1212,9 +1214,9 @@
 	pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 64);
 #endif
 
-	if (command & PCI_COMMAND_IO && (io_base & 3) == 1)
-		io_base &= PCI_BASE_ADDRESS_IO_MASK;
-	else {
+	if (! ((command & PCI_COMMAND_IO)
+	       && ((io_flags & PCI_BASE_ADDRESS_SPACE)
+		   == PCI_BASE_ADDRESS_SPACE_IO))) {
 		printk("qlogicisp : i/o mapping is disabled\n");
 		return 1;
 	}

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