ARM: dma-mapping: use dma_mmap_from_coherent()
Marek Szyprowski [Tue, 15 May 2012 17:04:13 +0000 (19:04 +0200)]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Conflicts:

arch/arm/mm/dma-mapping.c

Change-Id: I69eae1abd7baa42a2c93e13c3efdba05ba26cdab
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>

arch/arm/mm/dma-mapping.c

index 153f555..3037106 100644 (file)
@@ -639,6 +639,11 @@ static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
        int ret = -ENXIO;
 #ifdef CONFIG_MMU
        unsigned long pfn = dma_to_pfn(dev, dma_addr);
+       vma->vm_page_prot = __get_dma_pgprot(attrs, vma->vm_page_prot);
+
+       if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret))
+               return ret;
+
        ret = remap_pfn_range(vma, vma->vm_start,
                              pfn + vma->vm_pgoff,
                              vma->vm_end - vma->vm_start,