Skip to content

Commit

Permalink
pata_optidma: fix checking of DMA state
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Damien Le Moal <[email protected]>
  • Loading branch information
rdoeffinger authored and damien-lemoal committed Oct 12, 2021
1 parent 2367ad6 commit 492402c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ata/pata_optidma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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];
}
Expand Down

0 comments on commit 492402c

Please sign in to comment.