diff options
Diffstat (limited to 'drivers/ide/hpt366.c')
-rw-r--r-- | drivers/ide/hpt366.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c index 4d90ac2dbb1b..b885c1d548f5 100644 --- a/drivers/ide/hpt366.c +++ b/drivers/ide/hpt366.c | |||
@@ -627,14 +627,14 @@ static u32 get_speed_setting(u8 speed, struct hpt_info *info) | |||
627 | return info->timings->clock_table[info->clock][i]; | 627 | return info->timings->clock_table[info->clock][i]; |
628 | } | 628 | } |
629 | 629 | ||
630 | static void hpt3xx_set_mode(ide_drive_t *drive, const u8 speed) | 630 | static void hpt3xx_set_mode(ide_hwif_t *hwif, ide_drive_t *drive) |
631 | { | 631 | { |
632 | ide_hwif_t *hwif = drive->hwif; | ||
633 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 632 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
634 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); | 633 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
635 | struct hpt_timings *t = info->timings; | 634 | struct hpt_timings *t = info->timings; |
636 | u8 itr_addr = 0x40 + (drive->dn * 4); | 635 | u8 itr_addr = 0x40 + (drive->dn * 4); |
637 | u32 old_itr = 0; | 636 | u32 old_itr = 0; |
637 | const u8 speed = drive->dma_mode; | ||
638 | u32 new_itr = get_speed_setting(speed, info); | 638 | u32 new_itr = get_speed_setting(speed, info); |
639 | u32 itr_mask = speed < XFER_MW_DMA_0 ? t->pio_mask : | 639 | u32 itr_mask = speed < XFER_MW_DMA_0 ? t->pio_mask : |
640 | (speed < XFER_UDMA_0 ? t->dma_mask : | 640 | (speed < XFER_UDMA_0 ? t->dma_mask : |
@@ -651,9 +651,10 @@ static void hpt3xx_set_mode(ide_drive_t *drive, const u8 speed) | |||
651 | pci_write_config_dword(dev, itr_addr, new_itr); | 651 | pci_write_config_dword(dev, itr_addr, new_itr); |
652 | } | 652 | } |
653 | 653 | ||
654 | static void hpt3xx_set_pio_mode(ide_drive_t *drive, const u8 pio) | 654 | static void hpt3xx_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) |
655 | { | 655 | { |
656 | hpt3xx_set_mode(drive, XFER_PIO_0 + pio); | 656 | drive->dma_mode = drive->pio_mode; |
657 | hpt3xx_set_mode(hwif, drive); | ||
657 | } | 658 | } |
658 | 659 | ||
659 | static void hpt3xx_maskproc(ide_drive_t *drive, int mask) | 660 | static void hpt3xx_maskproc(ide_drive_t *drive, int mask) |