dtc2278: set ->pio_mask also for the second port
[cascardo/linux.git] / drivers / ide / legacy / dtc2278.c
index 36a3f0a..253a20f 100644 (file)
@@ -67,12 +67,10 @@ static void sub22 (char b, char c)
        }
 }
 
-static void tune_dtc2278 (ide_drive_t *drive, u8 pio)
+static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
 {
        unsigned long flags;
 
-       pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
-
        if (pio >= 3) {
                spin_lock_irqsave(&ide_lock, flags);
                /*
@@ -96,6 +94,7 @@ static int __init dtc2278_probe(void)
 {
        unsigned long flags;
        ide_hwif_t *hwif, *mate;
+       static u8 idx[4] = { 0, 1, 0xff, 0xff };
 
        hwif = &ide_hwifs[0];
        mate = &ide_hwifs[1];
@@ -123,23 +122,21 @@ static int __init dtc2278_probe(void)
 
        hwif->serialized = 1;
        hwif->chipset = ide_dtc2278;
-       hwif->tuneproc = &tune_dtc2278;
+       hwif->pio_mask = ATA_PIO4;
+       hwif->set_pio_mode = &dtc2278_set_pio_mode;
        hwif->drives[0].no_unmask = 1;
        hwif->drives[1].no_unmask = 1;
        hwif->mate = mate;
 
        mate->serialized = 1;
        mate->chipset = ide_dtc2278;
+       mate->pio_mask = ATA_PIO4;
        mate->drives[0].no_unmask = 1;
        mate->drives[1].no_unmask = 1;
        mate->mate = hwif;
        mate->channel = 1;
 
-       probe_hwif_init(hwif);
-       probe_hwif_init(mate);
-
-       ide_proc_register_port(hwif);
-       ide_proc_register_port(mate);
+       ide_device_add(idx);
 
        return 0;
 }