pata_amd: fix checking of DMA state
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Tue, 12 Oct 2021 06:27:47 +0000 (08:27 +0200)
committerDamien Le Moal <damien.lemoal@wdc.com>
Tue, 12 Oct 2021 08:46:55 +0000 (17:46 +0900)
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>
drivers/ata/pata_amd.c

index c8acba1..154748c 100644 (file)
@@ -66,7 +66,7 @@ static void timing_setup(struct ata_port *ap, struct ata_device *adev, int offse
 
        if (peer) {
                /* This may be over conservative */
-               if (peer->dma_mode) {
+               if (ata_dma_enabled(peer)) {
                        ata_timing_compute(peer, peer->dma_mode, &apeer, T, UT);
                        ata_timing_merge(&apeer, &at, &at, ATA_TIMING_8BIT);
                }