]> err.no Git - linux-2.6/blobdiff - drivers/ide/pci/triflex.c
ide: move ide_rate_filter() calls to the upper layer (take 2)
[linux-2.6] / drivers / ide / pci / triflex.c
index 35e8c612638f687509c42311c38d13973f92752c..47cf89be4dfc1422d9603709d2710d08a130e35c 100644 (file)
@@ -40,7 +40,7 @@
 #include <linux/ide.h>
 #include <linux/init.h>
 
-static int triflex_tune_chipset(ide_drive_t *drive, u8 xferspeed)
+static int triflex_tune_chipset(ide_drive_t *drive, const u8 speed)
 {
        ide_hwif_t *hwif = HWIF(drive);
        struct pci_dev *dev = hwif->pci_dev;
@@ -48,7 +48,6 @@ static int triflex_tune_chipset(ide_drive_t *drive, u8 xferspeed)
        u16 timing = 0;
        u32 triflex_timings = 0;
        u8 unit = (drive->select.b.unit & 0x01);
-       u8 speed = ide_rate_filter(drive, xferspeed);
        
        pci_read_config_dword(dev, channel_offset, &triflex_timings);
        
@@ -96,7 +95,7 @@ static int triflex_tune_chipset(ide_drive_t *drive, u8 xferspeed)
 
 static void triflex_tune_drive(ide_drive_t *drive, u8 pio)
 {
-       int use_pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
+       int use_pio = ide_get_best_pio_mode(drive, pio, 4);
        (void) triflex_tune_chipset(drive, (XFER_PIO_0 + use_pio));
 }
 
@@ -115,6 +114,9 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
        hwif->tuneproc = &triflex_tune_drive;
        hwif->speedproc = &triflex_tune_chipset;
 
+       if (hwif->dma_base == 0)
+               return;
+
        hwif->atapi_dma  = 1;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
@@ -129,10 +131,10 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
 static ide_pci_device_t triflex_device __devinitdata = {
        .name           = "TRIFLEX",
        .init_hwif      = init_hwif_triflex,
-       .channels       = 2,
        .autodma        = AUTODMA,
        .enablebits     = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}},
        .bootable       = ON_BOARD,
+       .pio_mask       = ATA_PIO4,
 };
 
 static int __devinit triflex_init_one(struct pci_dev *dev,