]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/amd74xx.c
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[linux-2.6-omap-h63xx.git] / drivers / ide / amd74xx.c
index c6bcd3014a29ec7891b3e11543cd6195ff30e985..69660a431cd9890f707c87d7e7a38f3429e643de 100644 (file)
@@ -82,7 +82,7 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed)
 {
        ide_hwif_t *hwif = drive->hwif;
        struct pci_dev *dev = to_pci_dev(hwif->dev);
-       ide_drive_t *peer = hwif->drives + (~drive->dn & 1);
+       ide_drive_t *peer = ide_get_pair_dev(drive);
        struct ide_timing t, p;
        int T, UT;
        u8 udma_mask = hwif->ultra_mask;
@@ -92,7 +92,7 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed)
 
        ide_timing_compute(drive, speed, &t, T, UT);
 
-       if (peer->dev_flags & IDE_DFLAG_PRESENT) {
+       if (peer) {
                ide_timing_compute(peer, peer->current_speed, &p, T, UT);
                ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
        }