Commit 492402ce authored by Reimar Döffinger's avatar Reimar Döffinger Committed by Damien Le Moal

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: default avatarReimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
parent 2367ad63
......@@ -153,7 +153,7 @@ static void optidma_mode_setup(struct ata_port *ap, struct ata_device *adev, u8
if (pair) {
u8 pair_addr;
/* Hardware constraint */
if (pair->dma_mode)
if (ata_dma_enabled(pair))
pair_addr = 0;
else
pair_addr = addr_timing[pci_clock][pair->pio_mode - XFER_PIO_0];
......@@ -301,7 +301,7 @@ static u8 optidma_make_bits43(struct ata_device *adev)
};
if (!ata_dev_enabled(adev))
return 0;
if (adev->dma_mode)
if (ata_dma_enabled(adev))
return adev->dma_mode - XFER_MW_DMA_0;
return bits43[adev->pio_mode - XFER_PIO_0];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment