]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/piix.c
ide: use PIO/MMIO operations directly where possible (v2)
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / piix.c
index 247334473519a778620a92bd95a505e927edd17c..85e8a78e10ad81f6538f7ce7870174d1b3cd3760 100644 (file)
@@ -387,19 +387,13 @@ static int piix_config_drive_for_dma (ide_drive_t *drive)
 static int piix_config_drive_xfer_rate (ide_drive_t *drive)
 {
        ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
 
        drive->init_speed = 0;
 
-       if ((id->capability & 1) && drive->autodma) {
+       if (ide_use_dma(drive) && piix_config_drive_for_dma(drive))
+               return hwif->ide_dma_on(drive);
 
-               if (ide_use_dma(drive) && piix_config_drive_for_dma(drive))
-                       return hwif->ide_dma_on(drive);
-
-               goto fast_ata_pio;
-
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive)) {
                /* Find best PIO mode. */
                (void) hwif->speedproc(drive, XFER_PIO_0 +
                                       ide_get_best_pio_mode(drive, 255, 4, NULL));