From: Hiroshi DOYU <hiroshi.d...@nokia.com>

MPU side (v)-(p) mapping is necessary only if IOVMF_MMIO is set in
"flags".

Signed-off-by: Hiroshi DOYU <hiroshi.d...@nokia.com>
---
 arch/arm/plat-omap/iovmm.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index 6fc52fc..004fd83 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -615,7 +615,7 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct 
sg_table *sgt,
                 u32 flags)
 {
        size_t bytes;
-       void *va;
+       void *va = NULL;
 
        if (!obj || !obj->dev || !sgt)
                return -EINVAL;
@@ -625,9 +625,11 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct 
sg_table *sgt,
                return -EINVAL;
        bytes = PAGE_ALIGN(bytes);
 
-       va = vmap_sg(sgt);
-       if (IS_ERR(va))
-               return PTR_ERR(va);
+       if (flags & IOVMF_MMIO) {
+               va = vmap_sg(sgt);
+               if (IS_ERR(va))
+                       return PTR_ERR(va);
+       }
 
        flags &= IOVMF_HW_MASK;
        flags |= IOVMF_DISCONT;
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to