ARM: mach-tegra: Fix vm_insert_pfn() return value
Arto Merilainen [Mon, 11 Mar 2013 10:59:00 +0000 (12:59 +0200)]
tegra_iovmm_vm_insert_pfn() returned 1 (true) instead of a valid
error code. This change converts the function to return -ENOMEM
in error cases.

Bug 1246095
Bug 1263718

Change-Id: I58b7475345361ae7a9dd260ce25eebbb05d88ad0
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/208050
(cherry picked from commit fad248c6c53f620057a920c7cfb2e6f9d00ff67b)
Reviewed-on: http://git-master/r/215998
Tested-by: Sandeep Shinde <sashinde@nvidia.com>
Reviewed-by: Sandeep Shinde <sashinde@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

arch/arm/mach-tegra/include/mach/iovmm.h

index b37bcd9..176e0e4 100644 (file)
@@ -379,7 +379,7 @@ static inline void tegra_iovmm_resume(void)
                dma_set_attr(DMA_ATTR_SKIP_CPU_SYNC, &attrs);           \
                da = ops->map_page_at(dev, pfn_to_page(pfn), handle,    \
                                 PAGE_SIZE, 0, 0, &attrs);              \
-               dma_mapping_error(dev, da);                             \
+               dma_mapping_error(dev, da) ? -ENOMEM : 0;               \
        })
 
 struct tegra_iovmm_area *tegra_iommu_create_vm(struct device *dev,