From 7dd00083b1160b560fa2a0a486799b57baa5d035 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 20 Jul 2007 01:11:56 +0200 Subject: ide: add ide_pio_cycle_time() helper (take 2) * Add ide_pio_cycle_time() helper. * Use it in ali14xx/ht6560b/qd65xx/cmd64{0,x}/sl82c105 and pmac host drivers (previously cycle time given by the device was only used for "pio" == 255). * Remove no longer needed ide_pio_data_t.cycle_time field. v2: * Fix "ata_" prefix (Noticed by Jeff). Acked-by: Sergei Shtylyov Cc: Jeff Garzik Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/legacy/ht6560b.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/ide/legacy/ht6560b.c') diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index c8f353b1296..85d16812d90 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c @@ -203,19 +203,21 @@ static u8 ht_pio2timings(ide_drive_t *drive, u8 pio) { int active_time, recovery_time; int active_cycles, recovery_cycles; - ide_pio_data_t d; int bus_speed = system_bus_clock(); if (pio) { - pio = ide_get_best_pio_mode(drive, pio, 5, &d); - + unsigned int cycle_time; + + pio = ide_get_best_pio_mode(drive, pio, 5, NULL); + cycle_time = ide_pio_cycle_time(drive, pio); + /* * Just like opti621.c we try to calculate the * actual cycle time for recovery and activity * according system bus speed. */ active_time = ide_pio_timings[pio].active_time; - recovery_time = d.cycle_time + recovery_time = cycle_time - active_time - ide_pio_timings[pio].setup_time; /* -- cgit v1.2.3-70-g09d2