aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/piix.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/piix.c')
-rw-r--r--drivers/ide/pci/piix.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 27781d294ce..bd6d3f77d30 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -203,20 +203,11 @@ static void piix_set_dma_mode(ide_drive_t *drive, const u8 speed)
203 pci_read_config_byte(dev, 0x54, &reg54); 203 pci_read_config_byte(dev, 0x54, &reg54);
204 pci_read_config_byte(dev, 0x55, &reg55); 204 pci_read_config_byte(dev, 0x55, &reg55);
205 205
206 switch(speed) {
207 case XFER_UDMA_4:
208 case XFER_UDMA_2: u_speed = 2 << (drive->dn * 4); break;
209 case XFER_UDMA_5:
210 case XFER_UDMA_3:
211 case XFER_UDMA_1: u_speed = 1 << (drive->dn * 4); break;
212 case XFER_UDMA_0: u_speed = 0 << (drive->dn * 4); break;
213 case XFER_MW_DMA_2:
214 case XFER_MW_DMA_1:
215 case XFER_SW_DMA_2: break;
216 default: return;
217 }
218
219 if (speed >= XFER_UDMA_0) { 206 if (speed >= XFER_UDMA_0) {
207 u8 udma = speed - XFER_UDMA_0;
208
209 u_speed = min_t(u8, 2 - (udma & 1), udma) << (drive->dn * 4);
210
220 if (!(reg48 & u_flag)) 211 if (!(reg48 & u_flag))
221 pci_write_config_byte(dev, 0x48, reg48 | u_flag); 212 pci_write_config_byte(dev, 0x48, reg48 | u_flag);
222 if (speed == XFER_UDMA_5) { 213 if (speed == XFER_UDMA_5) {