diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-07-19 19:11:56 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-07-19 19:11:56 -0400 |
commit | 7dd00083b1160b560fa2a0a486799b57baa5d035 (patch) | |
tree | 22e8cf2c740d55ff9b4fdf57b9593a357d0092b7 /drivers/ide/pci/cmd640.c | |
parent | 31c4df441cce6b9ec541e7f722f50bfbc617dd76 (diff) |
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 <sshtylyov@ru.mvista.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/cmd640.c')
-rw-r--r-- | drivers/ide/pci/cmd640.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c index dff21597e643..9f67ffc43421 100644 --- a/drivers/ide/pci/cmd640.c +++ b/drivers/ide/pci/cmd640.c | |||
@@ -633,9 +633,8 @@ static void cmd640_set_mode (unsigned int index, u8 pio_mode, unsigned int cycle | |||
633 | */ | 633 | */ |
634 | static void cmd640_tune_drive (ide_drive_t *drive, u8 mode_wanted) | 634 | static void cmd640_tune_drive (ide_drive_t *drive, u8 mode_wanted) |
635 | { | 635 | { |
636 | unsigned int index = 0, cycle_time; | ||
636 | u8 b; | 637 | u8 b; |
637 | ide_pio_data_t d; | ||
638 | unsigned int index = 0; | ||
639 | 638 | ||
640 | while (drive != cmd_drives[index]) { | 639 | while (drive != cmd_drives[index]) { |
641 | if (++index > 3) { | 640 | if (++index > 3) { |
@@ -662,13 +661,12 @@ static void cmd640_tune_drive (ide_drive_t *drive, u8 mode_wanted) | |||
662 | return; | 661 | return; |
663 | } | 662 | } |
664 | 663 | ||
665 | (void) ide_get_best_pio_mode (drive, mode_wanted, 5, &d); | 664 | mode_wanted = ide_get_best_pio_mode(drive, mode_wanted, 5, NULL); |
666 | cmd640_set_mode (index, d.pio_mode, d.cycle_time); | 665 | cycle_time = ide_pio_cycle_time(drive, mode_wanted); |
666 | cmd640_set_mode(index, mode_wanted, cycle_time); | ||
667 | 667 | ||
668 | printk("%s: selected cmd640 PIO mode%d (%dns)", | 668 | printk("%s: selected cmd640 PIO mode%d (%dns)", |
669 | drive->name, | 669 | drive->name, mode_wanted, cycle_time); |
670 | d.pio_mode, | ||
671 | d.cycle_time); | ||
672 | 670 | ||
673 | display_clocks(index); | 671 | display_clocks(index); |
674 | } | 672 | } |