]> Pileus Git - ~andy/linux/blobdiff - drivers/ide/pci/hpt34x.c
ide: add ide_use_fast_pio() helper (v3)
[~andy/linux] / drivers / ide / pci / hpt34x.c
index 0de3b61cabe33a3183a57edd17c0bba71a1fe6bd..0830089c77fd547938474b9fe138dbe14a6c35df 100644 (file)
@@ -110,25 +110,17 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 static int hpt34x_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 && (id->capability & 1) && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_for_dma(drive))
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
 #ifndef CONFIG_HPT34X_AUTODMA
-                               return hwif->ide_dma_off_quietly(drive);
+               return hwif->ide_dma_off_quietly(drive);
 #else
-                               return hwif->ide_dma_on(drive);
+               return hwif->ide_dma_on(drive);
 #endif
-               }
-
-               goto fast_ata_pio;
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive)) {
                hpt34x_tune_drive(drive, 255);
                return hwif->ide_dma_off_quietly(drive);
        }