]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/siimage.c
ide: add ide_use_fast_pio() helper (v3)
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / siimage.c
index cbca5f05ff87747036810f4426ad52504cac0107..367733c8c1de1b2c102762164725f60ef7ebad29 100644 (file)
@@ -396,12 +396,9 @@ static int config_chipset_for_dma (ide_drive_t *drive)
        if (!speed)
                return 0;
 
-       if (ide_set_xfer_rate(drive, speed))
+       if (siimage_tune_chipset(drive, speed))
                return 0;
 
-       if (!drive->init_speed)
-               drive->init_speed = speed;
-
        return ide_dma_enable(drive);
 }
 
@@ -418,19 +415,11 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 static int siimage_config_drive_for_dma (ide_drive_t *drive)
 {
        ide_hwif_t *hwif        = HWIF(drive);
-       struct hd_driveid *id   = drive->id;
-
-       if ((id->capability & 1) != 0 && drive->autodma) {
-
-               if (ide_use_dma(drive)) {
-                       if (config_chipset_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
 
-               goto fast_ata_pio;
+       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+               return hwif->ide_dma_on(drive);
 
-       } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
+       if (ide_use_fast_pio(drive)) {
                config_chipset_for_pio(drive, 1);
                return hwif->ide_dma_off_quietly(drive);
        }