staging: android: ion: Fix build error without CONFIG_AMLOGIC_ION_CODEC_MM 60/293660/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 1 Jun 2023 01:57:57 +0000 (10:57 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 1 Jun 2023 01:58:00 +0000 (10:58 +0900)
The amlogic codec ion is not used, threre is build error.
Fix the build error with checking config option.

Change-Id: Id21dcb4285facd5ed8c22082d8923be2c460909b
Fixes: deca8a9c7029 ("ion_dev: add codec_mm heap for omx. [3/3]")
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/staging/android/ion/Makefile
drivers/staging/android/ion/ion_heap.c
drivers/staging/android/ion/ion_priv.h

index 9fc31203cf1979d39c055a449147c713f5184e96..12b01248edfbb6fe631ecbd1075ac618d710b7c1 100644 (file)
@@ -1,10 +1,13 @@
 obj-$(CONFIG_ION) +=   ion.o ion-ioctl.o ion_heap.o \
                        ion_page_pool.o ion_system_heap.o \
-                       ion_carveout_heap.o ion_chunk_heap.o ion_cma_heap.o ion_codec_mm_heap.o
+                       ion_carveout_heap.o ion_chunk_heap.o ion_cma_heap.o
 obj-$(CONFIG_ION_TEST) += ion_test.o
 ifdef CONFIG_COMPAT
 obj-$(CONFIG_ION) += compat_ion.o
 endif
+ifdef CONFIG_AMLOGIC_MEDIA_CODEC_MM
+obj-$(CONFIG_ION) += ion_codec_mm_heap.o
+endif
 
 obj-$(CONFIG_ION_DUMMY) += ion_dummy_driver.o
 obj-$(CONFIG_ION_TEGRA) += tegra/
index 7300357860159b0760a9ec6bb5bfd56e829e669f..da2e75573a970d9ffadc23af5cec4b3fc9cc6bb7 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;
+#if defined(CONFIG_AMLOGIC_MEDIA_CODEC_MM)
        case ION_HEAP_TYPE_CUSTOM:
                heap = ion_codec_mm_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;
+#if defined(CONFIG_AMLOGIC_MEDIA_CODEC_MM)
        case ION_HEAP_TYPE_CUSTOM:
                ion_codec_mm_heap_destroy(heap);
                break;
+#endif
        default:
                pr_err("%s: Invalid heap type %d\n", __func__,
                       heap->type);
index b1371975c8d25be1c1fb136c628e44f7c17667a2..d557cf5e66c1cb9b434da8acbe85986f757f9c9b 100644 (file)
@@ -388,6 +388,7 @@ 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 *);
 
+#if defined(CONFIG_AMLOGIC_MEDIA_CODEC_MM)
 /**
  * The codec_mm heap returns physical addresses, since 0 may be a valid
  * physical address, this is used to indicate allocation failed
@@ -400,6 +401,7 @@ void ion_cma_heap_destroy(struct ion_heap *);
  */
 struct ion_heap *ion_codec_mm_heap_create(struct ion_platform_heap *heap_data);
 void ion_codec_mm_heap_destroy(struct ion_heap *heap);
+#endif
 
 /**
  * functions for creating and destroying a heap pool -- allows you