aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 14:33:37 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 14:33:37 -0400
commit288911af1209f5aa6119c9ec6d5a9bdb16a385b5 (patch)
treec1fbc9c8fd8ba30e33a52065178477a96aa30203 /drivers
parent2feecface7fd62be75bd4961324dc279a04bef22 (diff)
alim15x3: convert to use ide_timing_find_mode()
There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/Kconfig1
-rw-r--r--drivers/ide/pci/alim15x3.c6
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 86db707ad6cc..cadce92047fb 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -458,6 +458,7 @@ config BLK_DEV_AEC62XX
458 458
459config BLK_DEV_ALI15X3 459config BLK_DEV_ALI15X3
460 tristate "ALI M15x3 chipset support" 460 tristate "ALI M15x3 chipset support"
461 select IDE_TIMINGS
461 select BLK_DEV_IDEDMA_PCI 462 select BLK_DEV_IDEDMA_PCI
462 help 463 help
463 This driver ensures (U)DMA support for ALI 1533, 1543 and 1543C 464 This driver ensures (U)DMA support for ALI 1533, 1543 and 1543C
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index f2de00adf147..80d19c0eb780 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -69,7 +69,8 @@ static void ali_set_pio_mode(ide_drive_t *drive, const u8 pio)
69{ 69{
70 ide_hwif_t *hwif = HWIF(drive); 70 ide_hwif_t *hwif = HWIF(drive);
71 struct pci_dev *dev = to_pci_dev(hwif->dev); 71 struct pci_dev *dev = to_pci_dev(hwif->dev);
72 int s_time, a_time, c_time; 72 struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio);
73 int s_time = t->setup, a_time = t->active, c_time = t->cycle;
73 u8 s_clc, a_clc, r_clc; 74 u8 s_clc, a_clc, r_clc;
74 unsigned long flags; 75 unsigned long flags;
75 int bus_speed = ide_pci_clk ? ide_pci_clk : 33; 76 int bus_speed = ide_pci_clk ? ide_pci_clk : 33;
@@ -78,13 +79,10 @@ static void ali_set_pio_mode(ide_drive_t *drive, const u8 pio)
78 u8 cd_dma_fifo = 0; 79 u8 cd_dma_fifo = 0;
79 int unit = drive->select.b.unit & 1; 80 int unit = drive->select.b.unit & 1;
80 81
81 s_time = ide_pio_timings[pio].setup_time;
82 a_time = ide_pio_timings[pio].active_time;
83 if ((s_clc = (s_time * bus_speed + 999) / 1000) >= 8) 82 if ((s_clc = (s_time * bus_speed + 999) / 1000) >= 8)
84 s_clc = 0; 83 s_clc = 0;
85 if ((a_clc = (a_time * bus_speed + 999) / 1000) >= 8) 84 if ((a_clc = (a_time * bus_speed + 999) / 1000) >= 8)
86 a_clc = 0; 85 a_clc = 0;
87 c_time = ide_pio_timings[pio].cycle_time;
88 86
89 if (!(r_clc = (c_time * bus_speed + 999) / 1000 - a_clc - s_clc)) { 87 if (!(r_clc = (c_time * bus_speed + 999) / 1000 - a_clc - s_clc)) {
90 r_clc = 1; 88 r_clc = 1;