ide-pmac: fix drive->init_speed reporting
[profile/ivi/kernel-adaptation-intel-automotive.git] / drivers / ide / ppc / pmac.c
index 6693305..4b13cd9 100644 (file)
@@ -604,6 +604,9 @@ out:
                                drive->id->dma_1word |= 0x0101; break;
                        default: break;
                }
+               if (!drive->init_speed)
+                       drive->init_speed = command;
+               drive->current_speed = command;
        }
        enable_irq(hwif->irq);
        return result;
@@ -627,7 +630,7 @@ pmac_ide_tuneproc(ide_drive_t *drive, u8 pio)
        /* which drive is it ? */
        timings = &pmif->timings[drive->select.b.unit & 0x01];
 
-       pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
+       pio = ide_get_best_pio_mode(drive, pio, 4);
        cycle_time = ide_pio_cycle_time(drive, pio);
 
        switch (pmif->kind) {
@@ -986,7 +989,6 @@ pmac_ide_tune_chipset (ide_drive_t *drive, byte speed)
                return ret;
                
        pmac_ide_do_update_timings(drive);      
-       drive->current_speed = speed;
 
        return 0;
 }
@@ -1248,6 +1250,7 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
        hwif->cbl = pmif->cable_80 ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
        hwif->drives[0].unmask = 1;
        hwif->drives[1].unmask = 1;
+       hwif->pio_mask = ATA_PIO4;
        hwif->tuneproc = pmac_ide_tuneproc;
        if (pmif->kind == controller_un_ata6
            || pmif->kind == controller_k2_ata6
@@ -1736,11 +1739,6 @@ pmac_ide_mdma_enable(ide_drive_t *drive, u16 mode)
        /* Apply timings to controller */
        *timings = timing_local[0];
        *timings2 = timing_local[1];
-       
-       /* Set speed info in drive */
-       drive->current_speed = mode;    
-       if (!drive->init_speed)
-               drive->init_speed = mode;
 
        return 1;
 }
@@ -1792,11 +1790,6 @@ pmac_ide_udma_enable(ide_drive_t *drive, u16 mode)
        *timings = timing_local[0];
        *timings2 = timing_local[1];
 
-       /* Set speed info in drive */
-       drive->current_speed = mode;    
-       if (!drive->init_speed)
-               drive->init_speed = mode;
-
        return 1;
 }