Skip to content

Commit 15aedea

Browse files
fujitajoergroedel
authored andcommitted
dma-debug: use sg_dma_address accessor instead of using dma_address directly
Architectures might not have dma_address in struct scatterlist (PARISC doesn't). Directly accessing to dma_address in struct scatterlist is wrong; we need to use sg_dma_address() accesssor instead. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
1 parent ed888ae commit 15aedea

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎lib/dma-debug.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ void debug_dma_map_sg(struct device *dev, struct scatterlist *sg,
840840
entry->dev = dev;
841841
entry->paddr = sg_phys(s);
842842
entry->size = s->length;
843-
entry->dev_addr = s->dma_address;
843+
entry->dev_addr = sg_dma_address(s);
844844
entry->direction = direction;
845845
entry->sg_call_ents = nents;
846846
entry->sg_mapped_ents = mapped_ents;
@@ -872,7 +872,7 @@ void debug_dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
872872
.type = dma_debug_sg,
873873
.dev = dev,
874874
.paddr = sg_phys(s),
875-
.dev_addr = s->dma_address,
875+
.dev_addr = sg_dma_address(s),
876876
.size = s->length,
877877
.direction = dir,
878878
.sg_call_ents = 0,
@@ -996,8 +996,8 @@ void debug_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
996996
return;
997997

998998
for_each_sg(sg, s, nelems, i) {
999-
check_sync(dev, s->dma_address, s->dma_length, 0,
1000-
direction, true);
999+
check_sync(dev, sg_dma_address(s), s->dma_length, 0,
1000+
direction, true);
10011001
}
10021002
}
10031003
EXPORT_SYMBOL(debug_dma_sync_sg_for_cpu);
@@ -1012,8 +1012,8 @@ void debug_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
10121012
return;
10131013

10141014
for_each_sg(sg, s, nelems, i) {
1015-
check_sync(dev, s->dma_address, s->dma_length, 0,
1016-
direction, false);
1015+
check_sync(dev, sg_dma_address(s), s->dma_length, 0,
1016+
direction, false);
10171017
}
10181018
}
10191019
EXPORT_SYMBOL(debug_dma_sync_sg_for_device);

0 commit comments

Comments
 (0)