提交 78406ff5 编写于 作者: C Christoph Hellwig

arm: remove wrappers for the generic dma remap helpers

Remove a few tiny wrappers around the generic dma remap code.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 5cf45379
...@@ -339,18 +339,6 @@ static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp, ...@@ -339,18 +339,6 @@ static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp,
pgprot_t prot, struct page **ret_page, pgprot_t prot, struct page **ret_page,
const void *caller, bool want_vaddr); const void *caller, bool want_vaddr);
static void *
__dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot,
const void *caller)
{
return dma_common_contiguous_remap(page, size, prot, caller);
}
static void __dma_free_remap(void *cpu_addr, size_t size)
{
dma_common_free_remap(cpu_addr, size);
}
#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K #define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K
static struct gen_pool *atomic_pool __ro_after_init; static struct gen_pool *atomic_pool __ro_after_init;
...@@ -506,7 +494,7 @@ static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp, ...@@ -506,7 +494,7 @@ static void *__alloc_remap_buffer(struct device *dev, size_t size, gfp_t gfp,
if (!want_vaddr) if (!want_vaddr)
goto out; goto out;
ptr = __dma_alloc_remap(page, size, gfp, prot, caller); ptr = dma_common_contiguous_remap(page, size, prot, caller);
if (!ptr) { if (!ptr) {
__dma_free_buffer(page, size); __dma_free_buffer(page, size);
return NULL; return NULL;
...@@ -573,7 +561,7 @@ static void *__alloc_from_contiguous(struct device *dev, size_t size, ...@@ -573,7 +561,7 @@ static void *__alloc_from_contiguous(struct device *dev, size_t size,
goto out; goto out;
if (PageHighMem(page)) { if (PageHighMem(page)) {
ptr = __dma_alloc_remap(page, size, GFP_KERNEL, prot, caller); ptr = dma_common_contiguous_remap(page, size, prot, caller);
if (!ptr) { if (!ptr) {
dma_release_from_contiguous(dev, page, count); dma_release_from_contiguous(dev, page, count);
return NULL; return NULL;
...@@ -593,7 +581,7 @@ static void __free_from_contiguous(struct device *dev, struct page *page, ...@@ -593,7 +581,7 @@ static void __free_from_contiguous(struct device *dev, struct page *page,
{ {
if (want_vaddr) { if (want_vaddr) {
if (PageHighMem(page)) if (PageHighMem(page))
__dma_free_remap(cpu_addr, size); dma_common_free_remap(cpu_addr, size);
else else
__dma_remap(page, size, PAGE_KERNEL); __dma_remap(page, size, PAGE_KERNEL);
} }
...@@ -685,7 +673,7 @@ static void *remap_allocator_alloc(struct arm_dma_alloc_args *args, ...@@ -685,7 +673,7 @@ static void *remap_allocator_alloc(struct arm_dma_alloc_args *args,
static void remap_allocator_free(struct arm_dma_free_args *args) static void remap_allocator_free(struct arm_dma_free_args *args)
{ {
if (args->want_vaddr) if (args->want_vaddr)
__dma_free_remap(args->cpu_addr, args->size); dma_common_free_remap(args->cpu_addr, args->size);
__dma_free_buffer(args->page, args->size); __dma_free_buffer(args->page, args->size);
} }
...@@ -1357,16 +1345,6 @@ static int __iommu_free_buffer(struct device *dev, struct page **pages, ...@@ -1357,16 +1345,6 @@ static int __iommu_free_buffer(struct device *dev, struct page **pages,
return 0; return 0;
} }
/*
* Create a CPU mapping for a specified pages
*/
static void *
__iommu_alloc_remap(struct page **pages, size_t size, gfp_t gfp, pgprot_t prot,
const void *caller)
{
return dma_common_pages_remap(pages, size, prot, caller);
}
/* /*
* Create a mapping in device IO address space for specified pages * Create a mapping in device IO address space for specified pages
*/ */
...@@ -1518,7 +1496,7 @@ static void *__arm_iommu_alloc_attrs(struct device *dev, size_t size, ...@@ -1518,7 +1496,7 @@ static void *__arm_iommu_alloc_attrs(struct device *dev, size_t size,
if (attrs & DMA_ATTR_NO_KERNEL_MAPPING) if (attrs & DMA_ATTR_NO_KERNEL_MAPPING)
return pages; return pages;
addr = __iommu_alloc_remap(pages, size, gfp, prot, addr = dma_common_pages_remap(pages, size, prot,
__builtin_return_address(0)); __builtin_return_address(0));
if (!addr) if (!addr)
goto err_mapping; goto err_mapping;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册