Skip to content

Commit 492402c

Browse files
rdoeffingerdamien-lemoal
authored andcommitted
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 <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent 2367ad6 commit 492402c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/ata/pata_optidma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static void optidma_mode_setup(struct ata_port *ap, struct ata_device *adev, u8
153153
if (pair) {
154154
u8 pair_addr;
155155
/* Hardware constraint */
156-
if (pair->dma_mode)
156+
if (ata_dma_enabled(pair))
157157
pair_addr = 0;
158158
else
159159
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)
301301
};
302302
if (!ata_dev_enabled(adev))
303303
return 0;
304-
if (adev->dma_mode)
304+
if (ata_dma_enabled(adev))
305305
return adev->dma_mode - XFER_MW_DMA_0;
306306
return bits43[adev->pio_mode - XFER_PIO_0];
307307
}

0 commit comments

Comments
 (0)