aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/it8213.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/it8213.c')
-rw-r--r--drivers/ide/pci/it8213.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index 069152dd4697..2102167e4f08 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -93,7 +93,7 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed)
93 int w_flag = 0x10 << drive->dn; 93 int w_flag = 0x10 << drive->dn;
94 int u_speed = 0; 94 int u_speed = 0;
95 u16 reg4042, reg4a; 95 u16 reg4042, reg4a;
96 u8 reg48, reg54, reg55, pio; 96 u8 reg48, reg54, reg55;
97 97
98 pci_read_config_word(dev, maslave, &reg4042); 98 pci_read_config_word(dev, maslave, &reg4042);
99 pci_read_config_byte(dev, 0x48, &reg48); 99 pci_read_config_byte(dev, 0x48, &reg48);
@@ -134,10 +134,9 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed)
134 pci_write_config_byte(dev, 0x54, reg54 | v_flag); 134 pci_write_config_byte(dev, 0x54, reg54 | v_flag);
135 } else 135 } else
136 pci_write_config_byte(dev, 0x54, reg54 & ~v_flag); 136 pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
137
138 pio = 4;
139 } else { 137 } else {
140 const u8 mwdma_to_pio[] = { 0, 3, 4 }; 138 const u8 mwdma_to_pio[] = { 0, 3, 4 };
139 u8 pio;
141 140
142 if (reg48 & u_flag) 141 if (reg48 & u_flag)
143 pci_write_config_byte(dev, 0x48, reg48 & ~u_flag); 142 pci_write_config_byte(dev, 0x48, reg48 & ~u_flag);
@@ -152,9 +151,9 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed)
152 pio = mwdma_to_pio[speed - XFER_MW_DMA_0]; 151 pio = mwdma_to_pio[speed - XFER_MW_DMA_0];
153 else 152 else
154 pio = 2; /* only SWDMA2 is allowed */ 153 pio = 2; /* only SWDMA2 is allowed */
155 }
156 154
157 it8213_set_pio_mode(drive, pio); 155 it8213_set_pio_mode(drive, pio);
156 }
158} 157}
159 158
160/** 159/**