Commit 891039a9 authored by Emil Medve's avatar Emil Medve Committed by Jens Axboe

xtensa: fix sg->page fallout

Signed-off-by: default avatarEmil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 4e017764
...@@ -58,11 +58,10 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, ...@@ -58,11 +58,10 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
BUG_ON(direction == DMA_NONE); BUG_ON(direction == DMA_NONE);
for (i = 0; i < nents; i++, sg++ ) { for (i = 0; i < nents; i++, sg++ ) {
BUG_ON(!sg->page); BUG_ON(!sg_page(sg));
sg->dma_address = page_to_phys(sg->page) + sg->offset; sg->dma_address = sg_phys(sg);
consistent_sync(page_address(sg->page) + sg->offset, consistent_sync(sg_virt(sg), sg->length, direction);
sg->length, direction);
} }
return nents; return nents;
...@@ -128,8 +127,7 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, ...@@ -128,8 +127,7 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
{ {
int i; int i;
for (i = 0; i < nelems; i++, sg++) for (i = 0; i < nelems; i++, sg++)
consistent_sync(page_address(sg->page) + sg->offset, consistent_sync(sg_virt(sg), sg->length, dir);
sg->length, dir);
} }
static inline void static inline void
...@@ -138,8 +136,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, ...@@ -138,8 +136,7 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
{ {
int i; int i;
for (i = 0; i < nelems; i++, sg++) for (i = 0; i < nelems; i++, sg++)
consistent_sync(page_address(sg->page) + sg->offset, consistent_sync(sg_virt(sg), sg->length, dir);
sg->length, dir);
} }
static inline int static inline int
dma_mapping_error(dma_addr_t dma_addr) dma_mapping_error(dma_addr_t dma_addr)
......
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