staging/ion: fix unmapped heap conditional support
authorEtienne Carriere <etienne.carriere@linaro.org>
Mon, 18 Sep 2017 09:54:27 +0000 (11:54 +0200)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:56:43 +0000 (14:56 -0500)
Fixes: 7c7d9c446252 "staging/ion: CONFIG_ION_UNMAPPED_HEAP conditions unmapped heap"

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Joakim Bech <joakim.bech@linaro.org>
(cherry picked from commit bf829aa7c001c085a47c715e04cb3c347b1a38f8
 linaro repo https://github.com/linaro-swg/linux.git
 tag optee-v4.9-20171005)

drivers/staging/android/ion/ion_heap.c
drivers/staging/android/ion/ion_priv.h

index ee093ab..ff12f48 100644 (file)
@@ -335,9 +335,11 @@ struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data)
        case ION_HEAP_TYPE_DMA:
                heap = ion_cma_heap_create(heap_data);
                break;
+#ifdef CONFIG_ION_UNMAPPED_HEAP
        case ION_HEAP_TYPE_UNMAPPED:
                heap = ion_unmapped_heap_create(heap_data);
                break;
+#endif
        default:
                pr_err("%s: Invalid heap type %d\n", __func__,
                       heap_data->type);
@@ -378,9 +380,11 @@ void ion_heap_destroy(struct ion_heap *heap)
        case ION_HEAP_TYPE_DMA:
                ion_cma_heap_destroy(heap);
                break;
+#ifdef CONFIG_ION_UNMAPPED_HEAP
        case ION_HEAP_TYPE_UNMAPPED:
                ion_unmapped_heap_destroy(heap);
                break;
+#endif
        default:
                pr_err("%s: Invalid heap type %d\n", __func__,
                       heap->type);
index 7979cd7..c04ea26 100644 (file)
@@ -388,8 +388,10 @@ void ion_chunk_heap_destroy(struct ion_heap *);
 struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *);
 void ion_cma_heap_destroy(struct ion_heap *);
 
+#ifdef CONFIG_ION_UNMAPPED_HEAP
 struct ion_heap *ion_unmapped_heap_create(struct ion_platform_heap *pheap);
 void ion_unmapped_heap_destroy(struct ion_heap *heap);
+#endif
 
 /**
  * functions for creating and destroying a heap pool -- allows you