diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-02-25 14:28:22 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-02-25 14:28:22 -0500 |
commit | f76bee16fc83f58d6c1b088977330f26ed7ae248 (patch) | |
tree | 3937a77a4604baac37179b94a0b3c4857d83d4be /drivers/ide | |
parent | 43a12216d3664a9fa6c8ceb398da6ef08fee7ff7 (diff) |
atiixp: fix missing parentheses
Fix missing parentheses so PIO/DMA timings for master device on the
second channel are programmed correctly (IOW "8 0 24 16" offset values
should be used instead of the current "8 0 16 16").
[ The bug went unnoticed because after PIO/DMA timings get programmed
incorrectly for the third device they are overwritten with timings
for the fourth device and since BIOS should also program timings for
the third device everything should work fine until suspend/resume
cycle or user requested transfer mode changes. ]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
[bart: update patch description]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/atiixp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ide/atiixp.c b/drivers/ide/atiixp.c index b2735d28f5cc..ecd1e62ca91a 100644 --- a/drivers/ide/atiixp.c +++ b/drivers/ide/atiixp.c | |||
@@ -52,7 +52,7 @@ static void atiixp_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
52 | { | 52 | { |
53 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); | 53 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
54 | unsigned long flags; | 54 | unsigned long flags; |
55 | int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8; | 55 | int timing_shift = (drive->dn ^ 1) * 8; |
56 | u32 pio_timing_data; | 56 | u32 pio_timing_data; |
57 | u16 pio_mode_data; | 57 | u16 pio_mode_data; |
58 | 58 | ||
@@ -85,7 +85,7 @@ static void atiixp_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
85 | { | 85 | { |
86 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); | 86 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
87 | unsigned long flags; | 87 | unsigned long flags; |
88 | int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8; | 88 | int timing_shift = (drive->dn ^ 1) * 8; |
89 | u32 tmp32; | 89 | u32 tmp32; |
90 | u16 tmp16; | 90 | u16 tmp16; |
91 | u16 udma_ctl = 0; | 91 | u16 udma_ctl = 0; |