diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-01-06 11:20:56 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-01-06 11:20:56 -0500 |
commit | 07af5a5b0241422e4ca2dd114eaa1d7ad0165cb5 (patch) | |
tree | e737f7d5682fced43efff418372ea774369574ca /drivers/ide/it821x.c | |
parent | 5d44a1502ff711bea2a9b2bf2fbd2503081cf3be (diff) |
it821x: use ide_get_pair_dev() helper
Because presence of the peer device was not checked in
it821x_set_pio_mode() PIO0 mode was used for taskfile PIO
in single device configurations.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/it821x.c')
-rw-r--r-- | drivers/ide/it821x.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/ide/it821x.c b/drivers/ide/it821x.c index a34f3e19b4a4..879056645352 100644 --- a/drivers/ide/it821x.c +++ b/drivers/ide/it821x.c | |||
@@ -167,12 +167,10 @@ static void it821x_clock_strategy(ide_drive_t *drive) | |||
167 | ide_hwif_t *hwif = drive->hwif; | 167 | ide_hwif_t *hwif = drive->hwif; |
168 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 168 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
169 | struct it821x_dev *itdev = ide_get_hwifdata(hwif); | 169 | struct it821x_dev *itdev = ide_get_hwifdata(hwif); |
170 | ide_drive_t *pair; | 170 | ide_drive_t *pair = ide_get_pair_dev(drive); |
171 | int clock, altclock, sel = 0; | 171 | int clock, altclock, sel = 0; |
172 | u8 unit = drive->dn & 1, v; | 172 | u8 unit = drive->dn & 1, v; |
173 | 173 | ||
174 | pair = &hwif->drives[1 - unit]; | ||
175 | |||
176 | if(itdev->want[0][0] > itdev->want[1][0]) { | 174 | if(itdev->want[0][0] > itdev->want[1][0]) { |
177 | clock = itdev->want[0][1]; | 175 | clock = itdev->want[0][1]; |
178 | altclock = itdev->want[1][1]; | 176 | altclock = itdev->want[1][1]; |
@@ -239,15 +237,13 @@ static void it821x_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
239 | { | 237 | { |
240 | ide_hwif_t *hwif = drive->hwif; | 238 | ide_hwif_t *hwif = drive->hwif; |
241 | struct it821x_dev *itdev = ide_get_hwifdata(hwif); | 239 | struct it821x_dev *itdev = ide_get_hwifdata(hwif); |
242 | ide_drive_t *pair; | 240 | ide_drive_t *pair = ide_get_pair_dev(drive); |
243 | u8 unit = drive->dn & 1, set_pio = pio; | 241 | u8 unit = drive->dn & 1, set_pio = pio; |
244 | 242 | ||
245 | /* Spec says 89 ref driver uses 88 */ | 243 | /* Spec says 89 ref driver uses 88 */ |
246 | static u16 pio_timings[]= { 0xAA88, 0xA382, 0xA181, 0x3332, 0x3121 }; | 244 | static u16 pio_timings[]= { 0xAA88, 0xA382, 0xA181, 0x3332, 0x3121 }; |
247 | static u8 pio_want[] = { ATA_66, ATA_66, ATA_66, ATA_66, ATA_ANY }; | 245 | static u8 pio_want[] = { ATA_66, ATA_66, ATA_66, ATA_66, ATA_ANY }; |
248 | 246 | ||
249 | pair = &hwif->drives[1 - unit]; | ||
250 | |||
251 | /* | 247 | /* |
252 | * Compute the best PIO mode we can for a given device. We must | 248 | * Compute the best PIO mode we can for a given device. We must |
253 | * pick a speed that does not cause problems with the other device | 249 | * pick a speed that does not cause problems with the other device |