diff options
author | Laura Abbott <labbott@redhat.com> | 2017-04-18 11:27:10 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-18 20:43:14 +0200 |
commit | 2f87f50b234038ff91f67b4a98f2289ff630563a (patch) | |
tree | 82d312ca71d3b6a7bd0dc5e2864e64547f3a455b /drivers/staging/android/ion/ion_heap.c | |
parent | eb9751dbe6aaff217769d6bf2adc8eea684714a1 (diff) |
staging: android: ion: Rework heap registration/enumeration
The current model of Ion heap registration is based on the outdated
model of board files. The replacement for board files (devicetree)
isn't a good replacement for what Ion wants to do. In actuality, Ion
wants to show what memory is available in the system for something else
to figure out what to use. Switch to a model where Ion creates its
device unconditionally and heaps are registed as available regions.
Currently, only system and CMA heaps are converted over to the new
model. Carveout and chunk heaps can be converted over when someone wants
to figure out how.
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/ion/ion_heap.c')
-rw-r--r-- | drivers/staging/android/ion/ion_heap.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c index d8d057cab206..91faa7f035b9 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -314,74 +314,3 @@ void ion_heap_init_shrinker(struct ion_heap *heap) heap->shrinker.batch = 0; register_shrinker(&heap->shrinker); } - -struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data) -{ - struct ion_heap *heap = NULL; - - switch (heap_data->type) { - case ION_HEAP_TYPE_SYSTEM_CONTIG: - heap = ion_system_contig_heap_create(heap_data); - break; - case ION_HEAP_TYPE_SYSTEM: - heap = ion_system_heap_create(heap_data); - break; - case ION_HEAP_TYPE_CARVEOUT: - heap = ion_carveout_heap_create(heap_data); - break; - case ION_HEAP_TYPE_CHUNK: - heap = ion_chunk_heap_create(heap_data); - break; -#ifdef CONFIG_ION_CMA_HEAP - case ION_HEAP_TYPE_DMA: - heap = ion_cma_heap_create(heap_data); - break; -#endif - default: - pr_err("%s: Invalid heap type %d\n", __func__, - heap_data->type); - return ERR_PTR(-EINVAL); - } - - if (IS_ERR_OR_NULL(heap)) { - pr_err("%s: error creating heap %s type %d base %pa size %zu\n", - __func__, heap_data->name, heap_data->type, - &heap_data->base, heap_data->size); - return ERR_PTR(-EINVAL); - } - - heap->name = heap_data->name; - heap->id = heap_data->id; - return heap; -} -EXPORT_SYMBOL(ion_heap_create); - -void ion_heap_destroy(struct ion_heap *heap) -{ - if (!heap) - return; - - switch (heap->type) { - case ION_HEAP_TYPE_SYSTEM_CONTIG: - ion_system_contig_heap_destroy(heap); - break; - case ION_HEAP_TYPE_SYSTEM: - ion_system_heap_destroy(heap); - break; - case ION_HEAP_TYPE_CARVEOUT: - ion_carveout_heap_destroy(heap); - break; - case ION_HEAP_TYPE_CHUNK: - ion_chunk_heap_destroy(heap); - break; -#ifdef CONFIG_ION_CMA_HEAP - case ION_HEAP_TYPE_DMA: - ion_cma_heap_destroy(heap); - break; -#endif - default: - pr_err("%s: Invalid heap type %d\n", __func__, - heap->type); - } -} -EXPORT_SYMBOL(ion_heap_destroy); |