patch-2.3.99-pre2 linux/drivers/ide/piix.c

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

diff -u --recursive --new-file v2.3.99-pre1/linux/drivers/ide/piix.c linux/drivers/ide/piix.c
@@ -417,18 +417,22 @@
 
 void __init ide_init_piix (ide_hwif_t *hwif)
 {
+	if (!hwif->irq)
+		hwif->irq = hwif->channel ? 15 : 14;
+
 	hwif->tuneproc = &piix_tune_drive;
+	hwif->drives[0].autotune = 1;
+	hwif->drives[1].autotune = 1;
+
+	if (!hwif->dma_base)
+		return;
 
-	if (hwif->dma_base) {
 #ifdef CONFIG_PIIX_TUNING
-		hwif->dmaproc = &piix_dmaproc;
+	hwif->autodma = 1;
+	hwif->dmaproc = &piix_dmaproc;
+#else
+	if (hwif->autodma)
+		hwif->autodma = 0;
+
 #endif /* CONFIG_PIIX_TUNING */
-		hwif->drives[0].autotune = 0;
-		hwif->drives[1].autotune = 0;
-	} else {
-		hwif->drives[0].autotune = 1;
-		hwif->drives[1].autotune = 1;
-	}
-	if (!hwif->irq)
-		hwif->irq = hwif->channel ? 15 : 14;
 }

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