Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pata_ali: fix checking of DMA state

Checking if DMA is enabled should be done via the
ata_dma_enabled helper function, since the init state
0xff indicates disabled.
Change based on code review, not tested due to lack of hardware.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

authored by

Reimar Döffinger and committed by
Damien Le Moal
47b32049 6ac586f2

+2 -2
+2 -2
drivers/ata/pata_ali.c
··· 215 215 struct ata_timing p; 216 216 ata_timing_compute(pair, pair->pio_mode, &p, T, 1); 217 217 ata_timing_merge(&p, &t, &t, ATA_TIMING_SETUP|ATA_TIMING_8BIT); 218 - if (pair->dma_mode) { 218 + if (ata_dma_enabled(pair)) { 219 219 ata_timing_compute(pair, pair->dma_mode, &p, T, 1); 220 220 ata_timing_merge(&p, &t, &t, ATA_TIMING_SETUP|ATA_TIMING_8BIT); 221 221 } ··· 264 264 struct ata_timing p; 265 265 ata_timing_compute(pair, pair->pio_mode, &p, T, 1); 266 266 ata_timing_merge(&p, &t, &t, ATA_TIMING_SETUP|ATA_TIMING_8BIT); 267 - if (pair->dma_mode) { 267 + if (ata_dma_enabled(pair)) { 268 268 ata_timing_compute(pair, pair->dma_mode, &p, T, 1); 269 269 ata_timing_merge(&p, &t, &t, ATA_TIMING_SETUP|ATA_TIMING_8BIT); 270 270 }