patch-2.1.92 linux/drivers/block/ide-pci.c

Next file: linux/drivers/block/ide-probe.c
Previous file: linux/drivers/block/ide-floppy.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.91/linux/drivers/block/ide-pci.c linux/drivers/block/ide-pci.c
@@ -174,9 +174,13 @@
 	 * just in case there's another interface yet-to-be-scanned
 	 * which uses ports 1f0/170 (the ide0/ide1 defaults).
 	 */
-	for (h = 0; h < MAX_HWIFS; ++h) {
-		int hwifs[] = {2,3,1,0}; /* assign 3rd/4th before 1st/2nd */
-		hwif = &ide_hwifs[hwifs[h]];
+	for (h = 2; h < MAX_HWIFS; ++h) {
+		hwif = ide_hwifs + h;
+		if (hwif->chipset == ide_unknown)
+			return hwif;	/* pick an unused entry */
+	}
+	for (h = 0; h < 2; ++h) {
+		hwif = ide_hwifs + h;
 		if (hwif->chipset == ide_unknown)
 			return hwif;	/* pick an unused entry */
 	}
@@ -366,8 +370,10 @@
 		 * workaround Intel Advanced/ZP with bios <= 1.04;
 		 * these appear in some Dell Dimension XPS's 
 		 */
-		if (!hedt && IDE_PCI_DEVID_EQ(devid, DEVID_PIIXa))
+		if (!hedt && IDE_PCI_DEVID_EQ(devid, DEVID_PIIXa)) {
+			printk("ide: implementing workaround for PIIX detection\n");
 		        hedt = 0x80;
+		}
 
 		for (d = ide_pci_chipsets; d->devid.vid && !IDE_PCI_DEVID_EQ(d->devid, devid); ++d);
 		if (d->init_hwif == IDE_IGNORE)
@@ -382,7 +388,7 @@
 				printk("%s: IDE controller on PCI bus %d function %d\n", d->name, bus, fn);
 			ide_setup_pci_device(bus, fn, ccode, d);
 		}
-	} while (hedt == 0x80 && (++fn & 7));
+	} while ((hedt & 0x80) && (++fn & 7));
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov