Skip to content

Commit

Permalink
Blackfin arch: fix bug set dma_address properly in dma_map_sg
Browse files Browse the repository at this point in the history
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
  • Loading branch information
Sonic Zhang authored and Bryan Wu committed Jul 12, 2007
1 parent 157cc5a commit b07af76
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions arch/blackfin/kernel/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,13 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,

BUG_ON(direction == DMA_NONE);

for (i = 0; i < nents; i++)
invalidate_dcache_range(sg_dma_address(&sg[i]),
sg_dma_address(&sg[i]) +
sg_dma_len(&sg[i]));
for (i = 0; i < nents; i++, sg++) {
sg->dma_address = page_address(sg->page) + sg->offset;

invalidate_dcache_range(sg_dma_address(sg),
sg_dma_address(sg) +
sg_dma_len(sg));
}

return nents;
}
Expand Down

0 comments on commit b07af76

Please sign in to comment.