summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2011-06-08 09:06:11 +0300
committerOhad Ben-Cohen <ohad@wizery.com>2011-07-04 15:07:58 +0300
commit66cf402bd911d3874f986156d0bee8b943b71e7c (patch)
tree5fb35383e4c031d2f31308756b6a6d5f7cd07d67 /arch/arm/plat-omap
parent7e20b6f39aef541d890eba1fdf493f33b39d29e4 (diff)
omap: iovmm: s/sg_dma_len(sg)/sg->length/
iovmm is erroneously using sg_dma_len with unmapped (DMA API-wise) SG entries, and will break if CONFIG_NEED_SG_DMA_LENGTH is enabled. Fix that by using sg->length instead. Reported-by: Russell King <linux@arm.linux.org.uk> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/iovmm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index 51ef43e8def..a4596281352 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -72,7 +72,7 @@ static size_t sgtable_len(const struct sg_table *sgt)
for_each_sg(sgt->sgl, sg, sgt->nents, i) {
size_t bytes;
- bytes = sg_dma_len(sg);
+ bytes = sg->length;
if (!iopgsz_ok(bytes)) {
pr_err("%s: sg[%d] not iommu pagesize(%x)\n",
@@ -198,7 +198,7 @@ static void *vmap_sg(const struct sg_table *sgt)
int err;
pa = sg_phys(sg);
- bytes = sg_dma_len(sg);
+ bytes = sg->length;
BUG_ON(bytes != PAGE_SIZE);
@@ -476,7 +476,7 @@ static int map_iovm_area(struct iommu *obj, struct iovm_struct *new,
struct iotlb_entry e;
pa = sg_phys(sg);
- bytes = sg_dma_len(sg);
+ bytes = sg->length;
flags &= ~IOVMF_PGSZ_MASK;
pgsz = bytes_to_iopgsz(bytes);