[PATCH 12/21] cmd640: convert to use ide_timing_find_mode()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-ide@...>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@...>, <linux-kernel@...>
Date: Wednesday, May 28, 2008 - 5:42 pm

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/Kconfig      |    1 +
 drivers/ide/pci/cmd640.c |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

Index: b/drivers/ide/Kconfig
===================================================================
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -329,6 +329,7 @@ config BLK_DEV_PLATFORM
 config BLK_DEV_CMD640
 	tristate "CMD640 chipset bugfix/support"
 	depends on X86
+	select IDE_TIMINGS
 	---help---
 	  The CMD-Technologies CMD640 IDE chip is used on many common 486 and
 	  Pentium motherboards, usually in combination with a "Neptune" or
Index: b/drivers/ide/pci/cmd640.c
===================================================================
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -521,6 +521,7 @@ static void program_drive_counts(ide_dri
 static void cmd640_set_mode(ide_drive_t *drive, unsigned int index,
 			    u8 pio_mode, unsigned int cycle_time)
 {
+	struct ide_timing *t;
 	int setup_time, active_time, recovery_time, clock_time;
 	u8 setup_count, active_count, recovery_count, recovery_count2, cycle_count;
 	int bus_speed;
@@ -532,8 +533,11 @@ static void cmd640_set_mode(ide_drive_t 
 
 	if (pio_mode > 5)
 		pio_mode = 5;
-	setup_time  = ide_pio_timings[pio_mode].setup_time;
-	active_time = ide_pio_timings[pio_mode].active_time;
+
+	t = ide_timing_find_mode(XFER_PIO_0 + pio_mode);
+	setup_time  = t->setup;
+	active_time = t->active;
+
 	recovery_time = cycle_time - (setup_time + active_time);
 	clock_time = 1000 / bus_speed;
 	cycle_count = DIV_ROUND_UP(cycle_time, clock_time);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/21] ide: convert ide-timing.h to ide-timings.c lib..., Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:39 pm)
[PATCH 20/21] ide: remove no longer used ide_pio_timings[], Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:43 pm)
[PATCH 21/21] ide: move PIO blacklist to ide-pio-blacklist.c, Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:43 pm)
[PATCH 19/21] ide: move ide_pio_cycle_time() to ide-timings.c, Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:43 pm)
[PATCH 18/21] ide-pmac: convert to use ide_timing_find_mode(), Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:43 pm)
[PATCH 17/21] ide-mpc8xx: convert to use ide_timing_find_mod..., Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:43 pm)
[PATCH 16/21] sl82c105: convert to use ide_timing_find_mode(), Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:42 pm)
[PATCH 15/21] opti621: convert to use ide_timing_find_mode(), Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:42 pm)
[PATCH 14/21] cy82c693: convert to use ide_timing_find_mode(), Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:42 pm)
[PATCH 13/21] cmd64x: convert to use ide_timing_find_mode(), Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:42 pm)
[PATCH 12/21] cmd640: convert to use ide_timing_find_mode(), Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:42 pm)
[PATCH 11/21] alim15x3: convert to use ide_timing_find_mode(), Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:42 pm)
[PATCH 10/21] qd65xx: convert to use ide_timing_find_mode(), Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:42 pm)
[PATCH 09/21] ht6560b: convert to use ide_timing_find_mode(), Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:41 pm)
[PATCH 08/21] ali14xx: convert to use ide_timing_find_mode(), Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:40 pm)
[PATCH 07/21] ide: convert ide-timing.h to ide-timings.c lib..., Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:40 pm)
[PATCH 06/21] ide: checkpatch.pl fixes for ide-timing.h, Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:40 pm)
Re: [PATCH 06/21] ide: checkpatch.pl fixes for ide-timing.h, Sergei Shtylyov, (Fri May 30, 7:46 am)
[PATCH 05/21] ide: remove XFER_* masks from ide-timing.h, Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:40 pm)
Re: [PATCH 05/21] ide: remove XFER_* masks from ide-timing.h, Sergei Shtylyov, (Fri May 30, 7:46 am)
[PATCH 04/21] ide: move some bits from ide-timing.h to &lt;l..., Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:40 pm)
[PATCH 03/21] ide: use u8 for xfer modes in ide-timing.h, Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:40 pm)
[PATCH 02/21] ide: remove unused XFER_UDMA_SLOW, Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:40 pm)
Re: [PATCH 02/21] ide: remove unused XFER_UDMA_SLOW, Sergei Shtylyov, (Mon Jun 2, 7:43 am)
[PATCH 01/21] ide: remove needless includes from ide-lib.c, Bartlomiej Zolnierkiewicz..., (Wed May 28, 5:39 pm)