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

Next file: linux/drivers/scsi/pluto.c
Previous file: linux/drivers/scsi/mesh.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.15/linux/drivers/scsi/ncr53c8xx.c linux/drivers/scsi/ncr53c8xx.c
@@ -146,9 +146,6 @@
 #ifndef	__initdata
 #define	__initdata
 #endif
-#ifndef	__initfunc
-#define	__initfunc(__arginit) __arginit
-#endif
 #endif
 
 #if LINUX_VERSION_CODE <= LinuxVersionCode(2,1,92)
@@ -9578,8 +9575,10 @@
 static int __init 
 pci_get_base_address(struct pci_dev *pdev, int index, u_long *base)
 {
-	*base = pdev->resource[++index].start;
-	return index;
+	*base = pdev->resource[index].start;
+	if ((pdev->resource[index].flags & 0x7) == 0x4)
+		++index;
+	return ++index;
 }
 
 /*
@@ -9764,9 +9763,6 @@
 	 *	each and every PCI card, if they don't use Fcode?
 	 */
 
-	base = __pa(base);
-	base_2 = __pa(base_2);
-
 	if (!(command & PCI_COMMAND_MASTER)) {
 		if (initverbose >= 2)
 			printk("ncr53c8xx: setting PCI_COMMAND_MASTER bit (fixup)\n");
@@ -9807,28 +9803,16 @@
 
 	/*
 	 * Check availability of IO space, memory space and master capability.
+	 * No need to test BARs flags since they are hardwired to the
+	 * expected value.
 	 */
-	if (command & PCI_COMMAND_IO) { 
-		if ((io_port & 3) != 1) {
-			printk("ncr53c8xx: disabling I/O mapping since base address 0 (0x%x)\n"
-				"           bits 0..1 indicate a non-IO mapping\n", (int) io_port);
-			io_port = 0;
-		}
-		else
-			io_port &= PCI_BASE_ADDRESS_IO_MASK;
-	}
+	if (command & PCI_COMMAND_IO)
+		io_port &= PCI_BASE_ADDRESS_IO_MASK;
 	else
 		io_port = 0;
 
-	if (command & PCI_COMMAND_MEMORY) {
-		if ((base & PCI_BASE_ADDRESS_SPACE) != PCI_BASE_ADDRESS_SPACE_MEMORY) {
-			printk("ncr53c8xx: disabling memory mapping since base address 1\n"
-				"            contains a non-memory mapping\n");
-			base = 0;
-		}
-		else 
-			base &= PCI_BASE_ADDRESS_MEM_MASK;
-	}
+	if (command & PCI_COMMAND_MEMORY)
+		base &= PCI_BASE_ADDRESS_MEM_MASK;
 	else
 		base = 0;
 	

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