diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2011-06-08 02:06:11 -0400 |
---|---|---|
committer | Ohad Ben-Cohen <ohad@wizery.com> | 2011-07-04 08:07:58 -0400 |
commit | 66cf402bd911d3874f986156d0bee8b943b71e7c (patch) | |
tree | 5fb35383e4c031d2f31308756b6a6d5f7cd07d67 /arch/arm/plat-omap/iovmm.c | |
parent | 7e20b6f39aef541d890eba1fdf493f33b39d29e4 (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/iovmm.c')
-rw-r--r-- | arch/arm/plat-omap/iovmm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index 51ef43e8def6..a45962813521 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) | |||
72 | for_each_sg(sgt->sgl, sg, sgt->nents, i) { | 72 | for_each_sg(sgt->sgl, sg, sgt->nents, i) { |
73 | size_t bytes; | 73 | size_t bytes; |
74 | 74 | ||
75 | bytes = sg_dma_len(sg); | 75 | bytes = sg->length; |
76 | 76 | ||
77 | if (!iopgsz_ok(bytes)) { | 77 | if (!iopgsz_ok(bytes)) { |
78 | pr_err("%s: sg[%d] not iommu pagesize(%x)\n", | 78 | pr_err("%s: sg[%d] not iommu pagesize(%x)\n", |
@@ -198,7 +198,7 @@ static void *vmap_sg(const struct sg_table *sgt) | |||
198 | int err; | 198 | int err; |
199 | 199 | ||
200 | pa = sg_phys(sg); | 200 | pa = sg_phys(sg); |
201 | bytes = sg_dma_len(sg); | 201 | bytes = sg->length; |
202 | 202 | ||
203 | BUG_ON(bytes != PAGE_SIZE); | 203 | BUG_ON(bytes != PAGE_SIZE); |
204 | 204 | ||
@@ -476,7 +476,7 @@ static int map_iovm_area(struct iommu *obj, struct iovm_struct *new, | |||
476 | struct iotlb_entry e; | 476 | struct iotlb_entry e; |
477 | 477 | ||
478 | pa = sg_phys(sg); | 478 | pa = sg_phys(sg); |
479 | bytes = sg_dma_len(sg); | 479 | bytes = sg->length; |
480 | 480 | ||
481 | flags &= ~IOVMF_PGSZ_MASK; | 481 | flags &= ~IOVMF_PGSZ_MASK; |
482 | pgsz = bytes_to_iopgsz(bytes); | 482 | pgsz = bytes_to_iopgsz(bytes); |