Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[sfrench/cifs-2.6.git] / drivers / ide / pci / triflex.c
index f96b56838f339fb33de1d7d6b26972628c88daf2..5e06179c3469ed4a1fc7956d60fd95e389a630a2 100644 (file)
@@ -27,7 +27,6 @@
  *     Not publically available.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -105,29 +104,21 @@ static int triflex_config_drive_for_dma(ide_drive_t *drive)
 {
        int speed = ide_dma_speed(drive, 0); /* No ultra speeds */
 
-       if (!speed) { 
-               u8 pspeed = ide_get_best_pio_mode(drive, 255, 4, NULL);
-               speed = XFER_PIO_0 + pspeed;
-       }
-       
+       if (!speed)
+               return 0;
+
        (void) triflex_tune_chipset(drive, speed);
         return ide_dma_enable(drive);
 }
 
 static int triflex_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)) {
-                       if (triflex_config_drive_for_dma(drive))
-                               return hwif->ide_dma_on(drive);
-               }
-       }
+       if (ide_use_dma(drive) && triflex_config_drive_for_dma(drive))
+               return 0;
+
+       triflex_tune_drive(drive, 255);
 
-       hwif->tuneproc(drive, 255);
-       return hwif->ide_dma_off_quietly(drive);
+       return -1;
 }
 
 static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
@@ -174,7 +165,7 @@ static struct pci_driver driver = {
        .probe          = triflex_init_one,
 };
 
-static int triflex_ide_init(void)
+static int __init triflex_ide_init(void)
 {
        return ide_pci_register_driver(&driver);
 }