Skip to content

Commit bca4ff1

Browse files
committed
amd74xx: use ide_get_pair_dev() helper
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>
1 parent 627e05d commit bca4ff1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/ide/amd74xx.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed)
8282
{
8383
ide_hwif_t *hwif = drive->hwif;
8484
struct pci_dev *dev = to_pci_dev(hwif->dev);
85-
ide_drive_t *peer = hwif->drives + (~drive->dn & 1);
85+
ide_drive_t *peer = ide_get_pair_dev(drive);
8686
struct ide_timing t, p;
8787
int T, UT;
8888
u8 udma_mask = hwif->ultra_mask;
@@ -92,7 +92,7 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed)
9292

9393
ide_timing_compute(drive, speed, &t, T, UT);
9494

95-
if (peer->dev_flags & IDE_DFLAG_PRESENT) {
95+
if (peer) {
9696
ide_timing_compute(peer, peer->current_speed, &p, T, UT);
9797
ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
9898
}

0 commit comments

Comments
 (0)