struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data) { struct ion_cma_heap *cma_heap;
cma_heap = kzalloc(sizeof(struct ion_cma_heap), GFP_KERNEL); if (!cma_heap) return ERR_PTR(-ENOMEM);
cma_heap->heap.ops = &ion_cma_ops;
/* * get device from private heaps data, later it will be * used to make the link with reserved CMA memory */ cma_heap->dev = data->priv; cma_heap->heap.type = ION_HEAP_TYPE_DMA; return &cma_heap->heap;
}