ide: add ide_use_fast_pio() helper (v3)
[linux-2.6.git] / drivers / ide / pci / aec62xx.c
index cac12c3..1995073 100644 (file)
@@ -210,19 +210,11 @@ static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio)
 static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
 {
        ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
 
-       if ((id->capability & 1) && drive->autodma) {
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return hwif->ide_dma_on(drive);
 
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_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)) {
                aec62xx_tune_drive(drive, 5);
                return hwif->ide_dma_off_quietly(drive);
        }