aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeng Tao <prime.zeng@huawei.com>2014-12-09 09:19:40 +0800
committerJon Medhurst <tixy@linaro.org>2015-07-21 12:00:41 +0100
commita89823be77ac1c50b7d4bcf97dd36a7bd2630791 (patch)
tree5677cb915adb7c9b49803275eb107cf895127799
parent6fc41aed294d4e67f4732d4b9c073fed18409985 (diff)
staging: ion: ion_cma_heap: remove ion_cma_get_sgtable
Remove the temporary code ion_cma_get_sgtable, use dma_common_get_sgtable instead Signed-off-by: Zeng Tao <prime.zeng@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit e5e76d247f4a40827fef69a72939771943774e87) Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--drivers/staging/android/ion/ion_cma_heap.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c
index 4418bda76474..b7d5eaa23ab4 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -39,24 +39,6 @@ struct ion_cma_buffer_info {
struct sg_table *table;
};
-/*
- * Create scatter-list for the already allocated DMA buffer.
- * This function could be replaced by dma_common_get_sgtable
- * as soon as it will avalaible.
- */
-static int ion_cma_get_sgtable(struct device *dev, struct sg_table *sgt,
- void *cpu_addr, dma_addr_t handle, size_t size)
-{
- struct page *page = virt_to_page(cpu_addr);
- int ret;
-
- ret = sg_alloc_table(sgt, 1, GFP_KERNEL);
- if (unlikely(ret))
- return ret;
-
- sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0);
- return 0;
-}
/* ION CMA heap operations functions */
static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
@@ -95,7 +77,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
goto free_mem;
}
- if (ion_cma_get_sgtable
+ if (dma_common_get_sgtable
(dev, info->table, info->cpu_addr, info->handle, len))
goto free_table;
/* keep this for memory release */