Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5e76d24 authored by Zeng Tao's avatar Zeng Tao Committed by Greg Kroah-Hartman
Browse files

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: default avatarZeng Tao <prime.zeng@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1f5cf802
Loading
Loading
Loading
Loading
+1 −19
Original line number Original line Diff line number Diff line
@@ -39,24 +39,6 @@ struct ion_cma_buffer_info {
	struct sg_table *table;
	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 */
/* ION CMA heap operations functions */
static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
@@ -91,7 +73,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer,
	if (!info->table)
	if (!info->table)
		goto free_mem;
		goto free_mem;


	if (ion_cma_get_sgtable
	if (dma_common_get_sgtable
	    (dev, info->table, info->cpu_addr, info->handle, len))
	    (dev, info->table, info->cpu_addr, info->handle, len))
		goto free_table;
		goto free_table;
	/* keep this for memory release */
	/* keep this for memory release */