diff options
author | Christoph Hellwig <hch@lst.de> | 2019-06-03 09:14:31 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-09-04 11:13:20 +0200 |
commit | 5cf4537975bbd5691b9ddd015d540bb92f61e322 (patch) | |
tree | f77c8831902447d5c079eb8d36d4819d426d6e06 /arch/arm | |
parent | 512317401f6a337e617ec284d20dec5fa3a951ec (diff) |
dma-mapping: introduce a dma_common_find_pages helper
A helper to find the backing page array based on a virtual address.
This also ensures we do the same vm_flags check everywhere instead
of slightly different or missing ones in a few places.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index fd02c982e36a..97bf57df87c1 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1439,18 +1439,13 @@ static struct page **__atomic_get_pages(void *addr) static struct page **__iommu_get_pages(void *cpu_addr, unsigned long attrs) { - struct vm_struct *area; - if (__in_atomic_pool(cpu_addr, PAGE_SIZE)) return __atomic_get_pages(cpu_addr); if (attrs & DMA_ATTR_NO_KERNEL_MAPPING) return cpu_addr; - area = find_vm_area(cpu_addr); - if (area && (area->flags & VM_DMA_COHERENT)) - return area->pages; - return NULL; + return dma_common_find_pages(cpu_addr); } static void *__iommu_alloc_simple(struct device *dev, size_t size, gfp_t gfp, |