Skip to content

Commit

Permalink
pata_amd: 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 <Reimar.Doeffinger@gmx.de>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
  • Loading branch information
rdoeffinger authored and damien-lemoal committed Oct 12, 2021
1 parent 47b3204 commit 2367ad6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/pata_amd.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 2367ad6

Please sign in to comment.