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

pata_radisys: 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
1af5f7af 492402ce

+2 -2
+2 -2
drivers/ata/pata_radisys.c
··· 172 172 173 173 if (adev != ap->private_data) { 174 174 /* UDMA timing is not shared */ 175 - if (adev->dma_mode < XFER_UDMA_0) { 176 - if (adev->dma_mode) 175 + if (adev->dma_mode < XFER_UDMA_0 || !ata_dma_enabled(adev)) { 176 + if (ata_dma_enabled(adev)) 177 177 radisys_set_dmamode(ap, adev); 178 178 else if (adev->pio_mode) 179 179 radisys_set_piomode(ap, adev);