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

pata_optidma: 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
492402ce 2367ad63

+2 -2
+2 -2
drivers/ata/pata_optidma.c
··· 153 153 if (pair) { 154 154 u8 pair_addr; 155 155 /* Hardware constraint */ 156 - if (pair->dma_mode) 156 + if (ata_dma_enabled(pair)) 157 157 pair_addr = 0; 158 158 else 159 159 pair_addr = addr_timing[pci_clock][pair->pio_mode - XFER_PIO_0]; ··· 301 301 }; 302 302 if (!ata_dev_enabled(adev)) 303 303 return 0; 304 - if (adev->dma_mode) 304 + if (ata_dma_enabled(adev)) 305 305 return adev->dma_mode - XFER_MW_DMA_0; 306 306 return bits43[adev->pio_mode - XFER_PIO_0]; 307 307 }