Commit 86d688a3 authored by Sonic Zhang's avatar Sonic Zhang Committed by Bob Liu

blackfin: Call sg_for_each to pass through the whole sg list.

Otherwise, chained sg list may be missed.
Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarBob Liu <lliubbo@gmail.com>
parent c8d11a06
...@@ -122,12 +122,13 @@ void __dma_sync(dma_addr_t addr, size_t size, ...@@ -122,12 +122,13 @@ void __dma_sync(dma_addr_t addr, size_t size,
EXPORT_SYMBOL(__dma_sync); EXPORT_SYMBOL(__dma_sync);
int int
dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, dma_map_sg(struct device *dev, struct scatterlist *sg_list, int nents,
enum dma_data_direction direction) enum dma_data_direction direction)
{ {
struct scatterlist *sg;
int i; int i;
for (i = 0; i < nents; i++, sg++) { for_each_sg(sg_list, sg, nents, i) {
sg->dma_address = (dma_addr_t) sg_virt(sg); sg->dma_address = (dma_addr_t) sg_virt(sg);
__dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction); __dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction);
} }
...@@ -136,12 +137,13 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, ...@@ -136,12 +137,13 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
} }
EXPORT_SYMBOL(dma_map_sg); EXPORT_SYMBOL(dma_map_sg);
void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg_list,
int nelems, enum dma_data_direction direction) int nelems, enum dma_data_direction direction)
{ {
struct scatterlist *sg;
int i; int i;
for (i = 0; i < nelems; i++, sg++) { for_each_sg(sg_list, sg, nelems, i) {
sg->dma_address = (dma_addr_t) sg_virt(sg); sg->dma_address = (dma_addr_t) sg_virt(sg);
__dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction); __dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment