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.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index 90b52ed37bfc..2a0f45c4f4c4 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -101,24 +101,11 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed)
101 pci_read_config_byte(dev, 0x54, &reg54); 101 pci_read_config_byte(dev, 0x54, &reg54);
102 pci_read_config_byte(dev, 0x55, &reg55); 102 pci_read_config_byte(dev, 0x55, &reg55);
103 103
104 switch(speed) {
105 case XFER_UDMA_6:
106 case XFER_UDMA_4:
107 case XFER_UDMA_2: u_speed = 2 << (drive->dn * 4); break;
108 case XFER_UDMA_5:
109 case XFER_UDMA_3:
110 case XFER_UDMA_1: u_speed = 1 << (drive->dn * 4); break;
111 case XFER_UDMA_0: u_speed = 0 << (drive->dn * 4); break;
112 break;
113 case XFER_MW_DMA_2:
114 case XFER_MW_DMA_1:
115 case XFER_SW_DMA_2:
116 break;
117 default:
118 return;
119 }
120
121 if (speed >= XFER_UDMA_0) { 104 if (speed >= XFER_UDMA_0) {
105 u8 udma = speed - XFER_UDMA_0;
106
107 u_speed = min_t(u8, 2 - (udma & 1), udma) << (drive->dn * 4);
108
122 if (!(reg48 & u_flag)) 109 if (!(reg48 & u_flag))
123 pci_write_config_byte(dev, 0x48, reg48 | u_flag); 110 pci_write_config_byte(dev, 0x48, reg48 | u_flag);
124 if (speed >= XFER_UDMA_5) { 111 if (speed >= XFER_UDMA_5) {