ide-pmac: fix drive->init_speed reporting

pmac_ide_tune_chipset() don't set drive->init_speed.

Fix it by setting drive->{current,init}_speed in pmac_ide_do_setfeature()
and clean up pmac_ide_{tune_chipset,mdma_enable,udma_enable}().
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 1116fae5
...@@ -604,6 +604,9 @@ pmac_ide_do_setfeature(ide_drive_t *drive, u8 command) ...@@ -604,6 +604,9 @@ pmac_ide_do_setfeature(ide_drive_t *drive, u8 command)
drive->id->dma_1word |= 0x0101; break; drive->id->dma_1word |= 0x0101; break;
default: break; default: break;
} }
if (!drive->init_speed)
drive->init_speed = command;
drive->current_speed = command;
} }
enable_irq(hwif->irq); enable_irq(hwif->irq);
return result; return result;
...@@ -986,7 +989,6 @@ pmac_ide_tune_chipset (ide_drive_t *drive, byte speed) ...@@ -986,7 +989,6 @@ pmac_ide_tune_chipset (ide_drive_t *drive, byte speed)
return ret; return ret;
pmac_ide_do_update_timings(drive); pmac_ide_do_update_timings(drive);
drive->current_speed = speed;
return 0; return 0;
} }
...@@ -1737,11 +1739,6 @@ pmac_ide_mdma_enable(ide_drive_t *drive, u16 mode) ...@@ -1737,11 +1739,6 @@ pmac_ide_mdma_enable(ide_drive_t *drive, u16 mode)
/* Apply timings to controller */ /* Apply timings to controller */
*timings = timing_local[0]; *timings = timing_local[0];
*timings2 = timing_local[1]; *timings2 = timing_local[1];
/* Set speed info in drive */
drive->current_speed = mode;
if (!drive->init_speed)
drive->init_speed = mode;
return 1; return 1;
} }
...@@ -1793,11 +1790,6 @@ pmac_ide_udma_enable(ide_drive_t *drive, u16 mode) ...@@ -1793,11 +1790,6 @@ pmac_ide_udma_enable(ide_drive_t *drive, u16 mode)
*timings = timing_local[0]; *timings = timing_local[0];
*timings2 = timing_local[1]; *timings2 = timing_local[1];
/* Set speed info in drive */
drive->current_speed = mode;
if (!drive->init_speed)
drive->init_speed = mode;
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment