crypto: vmac - Fix big-endian support
[safe/jmp/linux-2.6] / drivers / ide / amd74xx.c
index 108e9b6..3747b25 100644 (file)
@@ -79,14 +79,14 @@ static void amd_set_speed(struct pci_dev *dev, u8 dn, u8 udma_mask,
  * to a desired transfer mode.  It also can be called by upper layers.
  */
 
-static void amd_set_drive(ide_drive_t *drive, const u8 speed)
+static void amd_set_drive(ide_hwif_t *hwif, ide_drive_t *drive)
 {
-       ide_hwif_t *hwif = drive->hwif;
        struct pci_dev *dev = to_pci_dev(hwif->dev);
        ide_drive_t *peer = ide_get_pair_dev(drive);
        struct ide_timing t, p;
        int T, UT;
        u8 udma_mask = hwif->ultra_mask;
+       const u8 speed = drive->dma_mode;
 
        T = 1000000000 / amd_clock;
        UT = (udma_mask == ATA_UDMA2) ? T : (T / 2);
@@ -94,7 +94,7 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed)
        ide_timing_compute(drive, speed, &t, T, UT);
 
        if (peer) {
-               ide_timing_compute(peer, peer->current_speed, &p, T, UT);
+               ide_timing_compute(peer, peer->pio_mode, &p, T, UT);
                ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
        }
 
@@ -108,9 +108,10 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed)
  * amd_set_pio_mode() is a callback from upper layers for PIO-only tuning.
  */
 
-static void amd_set_pio_mode(ide_drive_t *drive, const u8 pio)
+static void amd_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
 {
-       amd_set_drive(drive, XFER_PIO_0 + pio);
+       drive->dma_mode = drive->pio_mode;
+       amd_set_drive(hwif, drive);
 }
 
 static void amd7409_cable_detect(struct pci_dev *dev)