Skip to content

Commit 47b3204

Browse files
rdoeffingerdamien-lemoal
authored andcommitted
pata_ali: 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 6ac586f commit 47b3204

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/ata/pata_ali.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static void ali_set_piomode(struct ata_port *ap, struct ata_device *adev)
215215
struct ata_timing p;
216216
ata_timing_compute(pair, pair->pio_mode, &p, T, 1);
217217
ata_timing_merge(&p, &t, &t, ATA_TIMING_SETUP|ATA_TIMING_8BIT);
218-
if (pair->dma_mode) {
218+
if (ata_dma_enabled(pair)) {
219219
ata_timing_compute(pair, pair->dma_mode, &p, T, 1);
220220
ata_timing_merge(&p, &t, &t, ATA_TIMING_SETUP|ATA_TIMING_8BIT);
221221
}
@@ -264,7 +264,7 @@ static void ali_set_dmamode(struct ata_port *ap, struct ata_device *adev)
264264
struct ata_timing p;
265265
ata_timing_compute(pair, pair->pio_mode, &p, T, 1);
266266
ata_timing_merge(&p, &t, &t, ATA_TIMING_SETUP|ATA_TIMING_8BIT);
267-
if (pair->dma_mode) {
267+
if (ata_dma_enabled(pair)) {
268268
ata_timing_compute(pair, pair->dma_mode, &p, T, 1);
269269
ata_timing_merge(&p, &t, &t, ATA_TIMING_SETUP|ATA_TIMING_8BIT);
270270
}

0 commit comments

Comments
 (0)