ide: add ide_use_fast_pio() helper (v3)
[linux-2.6.git] / drivers / ide / pci / sis5513.c
index e71552e..4fff663 100644 (file)
@@ -670,23 +670,15 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 static int sis5513_config_xfer_rate(ide_drive_t *drive)
 {
        ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
 
        config_art_rwp_pio(drive, 5);
 
        drive->init_speed = 0;
 
-       if (id && (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)) {
                sis5513_tune_drive(drive, 5);
                return hwif->ide_dma_off_quietly(drive);
        }