diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2021-10-12 09:27:48 +0300 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@wdc.com> | 2021-10-12 11:46:59 +0300 |
commit | 492402ce70777b2f83dd61613c8e341a36ba3cd1 (patch) | |
tree | 11e54f6554be836daa7c549218ff7105344ce032 /drivers/ata/pata_optidma.c | |
parent | 2367ad63a1314f861dcd66c50d6e5508bb1edac1 (diff) | |
download | linux-492402ce70777b2f83dd61613c8e341a36ba3cd1.tar.xz |
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>
Diffstat (limited to 'drivers/ata/pata_optidma.c')
-rw-r--r-- | drivers/ata/pata_optidma.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/pata_optidma.c b/drivers/ata/pata_optidma.c index f6278d9de348..ad1090b90e52 100644 --- a/drivers/ata/pata_optidma.c +++ b/drivers/ata/pata_optidma.c @@ -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]; } |