diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:12:59 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:12:59 -0500 |
commit | 7b971df185807ceb358471e16ce8754ccfcc7de9 (patch) | |
tree | ace1d2e4dcb11a5da560cb758faca64f0e5628d7 /drivers/ide/pci | |
parent | 08590556d65b2611c5821bc532ca30db776e6044 (diff) |
serverworks: cleanup ->set_dma_mode method
IDE core guarantees that ->set_dma_mode will be called only
for DMA modes set in SWDMA/MWDMA/UDMA masks.
There should be no functionality changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r-- | drivers/ide/pci/serverworks.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index e9bd269547bb..877c09bf4829 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c | |||
@@ -164,25 +164,12 @@ static void svwks_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
164 | ultra_timing &= ~(0x0F << (4*unit)); | 164 | ultra_timing &= ~(0x0F << (4*unit)); |
165 | ultra_enable &= ~(0x01 << drive->dn); | 165 | ultra_enable &= ~(0x01 << drive->dn); |
166 | 166 | ||
167 | switch(speed) { | 167 | if (speed >= XFER_UDMA_0) { |
168 | case XFER_MW_DMA_2: | 168 | dma_timing |= dma_modes[2]; |
169 | case XFER_MW_DMA_1: | 169 | ultra_timing |= (udma_modes[speed - XFER_UDMA_0] << (4 * unit)); |
170 | case XFER_MW_DMA_0: | 170 | ultra_enable |= (0x01 << drive->dn); |
171 | dma_timing |= dma_modes[speed - XFER_MW_DMA_0]; | 171 | } else if (speed >= XFER_MW_DMA_0) |
172 | break; | 172 | dma_timing |= dma_modes[speed - XFER_MW_DMA_0]; |
173 | |||
174 | case XFER_UDMA_5: | ||
175 | case XFER_UDMA_4: | ||
176 | case XFER_UDMA_3: | ||
177 | case XFER_UDMA_2: | ||
178 | case XFER_UDMA_1: | ||
179 | case XFER_UDMA_0: | ||
180 | dma_timing |= dma_modes[2]; | ||
181 | ultra_timing |= ((udma_modes[speed - XFER_UDMA_0]) << (4*unit)); | ||
182 | ultra_enable |= (0x01 << drive->dn); | ||
183 | default: | ||
184 | break; | ||
185 | } | ||
186 | 173 | ||
187 | pci_write_config_byte(dev, drive_pci2[drive->dn], dma_timing); | 174 | pci_write_config_byte(dev, drive_pci2[drive->dn], dma_timing); |
188 | pci_write_config_byte(dev, (0x56|hwif->channel), ultra_timing); | 175 | pci_write_config_byte(dev, (0x56|hwif->channel), ultra_timing); |