summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Ripard <mripard@kernel.org>2026-04-27 12:04:58 +0200
committerSumit Semwal <sumit.semwal@linaro.org>2026-05-21 20:57:15 +0530
commit10bb37fc624cfcc1d10e0ebfc1b829401abba91e (patch)
tree1b50bdd62505f61f608784a3195e7795bbb42578
parentf78a0607c8bf6912943527175db61996436d5792 (diff)
downloadlinux-10bb37fc624cfcc1d10e0ebfc1b829401abba91e.tar.gz
linux-10bb37fc624cfcc1d10e0ebfc1b829401abba91e.zip
dma-buf: heaps: cma: Turn the heap into a module
All the symbols used by the CMA heap are already exported, so turning it into a module is straightforward. We only need to add the usual MODULE_* macros, import the proper namespaces and change the Kconfig symbol to a tristate. This heap won't be able to unload though, since we're missing a lot of infrastructure to make it safe. Reviewed-by: T.J. Mercier <tjmercier@google.com> Acked-by: Andrew Davis <afd@ti.com> Signed-off-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Link: https://patch.msgid.link/20260427-dma-buf-heaps-as-modules-v5-2-b6f5678feefc@kernel.org
-rw-r--r--drivers/dma-buf/heaps/Kconfig2
-rw-r--r--drivers/dma-buf/heaps/cma_heap.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/dma-buf/heaps/Kconfig b/drivers/dma-buf/heaps/Kconfig
index a5eef06c4226..aed0b9b4febf 100644
--- a/drivers/dma-buf/heaps/Kconfig
+++ b/drivers/dma-buf/heaps/Kconfig
@@ -6,7 +6,7 @@ config DMABUF_HEAPS_SYSTEM
is backed by pages from the buddy allocator. If in doubt, say Y.
config DMABUF_HEAPS_CMA
- bool "DMA-BUF CMA Heap"
+ tristate "DMA-BUF CMA Heap"
depends on DMABUF_HEAPS && DMA_CMA
help
Choose this option to enable dma-buf CMA heap. This heap is backed
diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c
index a359aac45579..3fb4b946c91a 100644
--- a/drivers/dma-buf/heaps/cma_heap.c
+++ b/drivers/dma-buf/heaps/cma_heap.c
@@ -420,3 +420,6 @@ static int __init add_cma_heaps(void)
}
module_init(add_cma_heaps);
MODULE_DESCRIPTION("DMA-BUF CMA Heap");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS("DMA_BUF");
+MODULE_IMPORT_NS("DMA_BUF_HEAP");