aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-xtensa/dma-mapping.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/include/asm-xtensa/dma-mapping.h b/include/asm-xtensa/dma-mapping.h
index 82b03b3a2ee6..8bd9d2c02a24 100644
--- a/include/asm-xtensa/dma-mapping.h
+++ b/include/asm-xtensa/dma-mapping.h
@@ -58,11 +58,10 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
58 BUG_ON(direction == DMA_NONE); 58 BUG_ON(direction == DMA_NONE);
59 59
60 for (i = 0; i < nents; i++, sg++ ) { 60 for (i = 0; i < nents; i++, sg++ ) {
61 BUG_ON(!sg->page); 61 BUG_ON(!sg_page(sg));
62 62
63 sg->dma_address = page_to_phys(sg->page) + sg->offset; 63 sg->dma_address = sg_phys(sg);
64 consistent_sync(page_address(sg->page) + sg->offset, 64 consistent_sync(sg_virt(sg), sg->length, direction);
65 sg->length, direction);
66 } 65 }
67 66
68 return nents; 67 return nents;
@@ -128,8 +127,7 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
128{ 127{
129 int i; 128 int i;
130 for (i = 0; i < nelems; i++, sg++) 129 for (i = 0; i < nelems; i++, sg++)
131 consistent_sync(page_address(sg->page) + sg->offset, 130 consistent_sync(sg_virt(sg), sg->length, dir);
132 sg->length, dir);
133} 131}
134 132
135static inline void 133static inline void
@@ -138,8 +136,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
138{ 136{
139 int i; 137 int i;
140 for (i = 0; i < nelems; i++, sg++) 138 for (i = 0; i < nelems; i++, sg++)
141 consistent_sync(page_address(sg->page) + sg->offset, 139 consistent_sync(sg_virt(sg), sg->length, dir);
142 sg->length, dir);
143} 140}
144static inline int 141static inline int
145dma_mapping_error(dma_addr_t dma_addr) 142dma_mapping_error(dma_addr_t dma_addr)