Commit 15aedea439c4d7dbec17c99b5e1594c01b979833
Committed by
Joerg Roedel
1 parent
ed888aef42
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff
lib/dma-debug.c
... | ... | @@ -840,7 +840,7 @@ |
840 | 840 | entry->dev = dev; |
841 | 841 | entry->paddr = sg_phys(s); |
842 | 842 | entry->size = s->length; |
843 | - entry->dev_addr = s->dma_address; | |
843 | + entry->dev_addr = sg_dma_address(s); | |
844 | 844 | entry->direction = direction; |
845 | 845 | entry->sg_call_ents = nents; |
846 | 846 | entry->sg_mapped_ents = mapped_ents; |
... | ... | @@ -872,7 +872,7 @@ |
872 | 872 | .type = dma_debug_sg, |
873 | 873 | .dev = dev, |
874 | 874 | .paddr = sg_phys(s), |
875 | - .dev_addr = s->dma_address, | |
875 | + .dev_addr = sg_dma_address(s), | |
876 | 876 | .size = s->length, |
877 | 877 | .direction = dir, |
878 | 878 | .sg_call_ents = 0, |
... | ... | @@ -996,8 +996,8 @@ |
996 | 996 | return; |
997 | 997 | |
998 | 998 | 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); | |
1001 | 1001 | } |
1002 | 1002 | } |
1003 | 1003 | EXPORT_SYMBOL(debug_dma_sync_sg_for_cpu); |
... | ... | @@ -1012,8 +1012,8 @@ |
1012 | 1012 | return; |
1013 | 1013 | |
1014 | 1014 | 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); | |
1017 | 1017 | } |
1018 | 1018 | } |
1019 | 1019 | EXPORT_SYMBOL(debug_dma_sync_sg_for_device); |