aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/dma-mapping.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/kernel/dma-mapping.c')
-rw-r--r--arch/blackfin/kernel/dma-mapping.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c
index f0d1118f1825..e7be6532d6a0 100644
--- a/arch/blackfin/kernel/dma-mapping.c
+++ b/arch/blackfin/kernel/dma-mapping.c
@@ -122,12 +122,13 @@ void __dma_sync(dma_addr_t addr, size_t size,
122EXPORT_SYMBOL(__dma_sync); 122EXPORT_SYMBOL(__dma_sync);
123 123
124int 124int
125dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 125dma_map_sg(struct device *dev, struct scatterlist *sg_list, int nents,
126 enum dma_data_direction direction) 126 enum dma_data_direction direction)
127{ 127{
128 struct scatterlist *sg;
128 int i; 129 int i;
129 130
130 for (i = 0; i < nents; i++, sg++) { 131 for_each_sg(sg_list, sg, nents, i) {
131 sg->dma_address = (dma_addr_t) sg_virt(sg); 132 sg->dma_address = (dma_addr_t) sg_virt(sg);
132 __dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction); 133 __dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction);
133 } 134 }
@@ -136,12 +137,13 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
136} 137}
137EXPORT_SYMBOL(dma_map_sg); 138EXPORT_SYMBOL(dma_map_sg);
138 139
139void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, 140void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg_list,
140 int nelems, enum dma_data_direction direction) 141 int nelems, enum dma_data_direction direction)
141{ 142{
143 struct scatterlist *sg;
142 int i; 144 int i;
143 145
144 for (i = 0; i < nelems; i++, sg++) { 146 for_each_sg(sg_list, sg, nelems, i) {
145 sg->dma_address = (dma_addr_t) sg_virt(sg); 147 sg->dma_address = (dma_addr_t) sg_virt(sg);
146 __dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction); 148 __dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction);
147 } 149 }