]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm: cma: Export cma_alloc(), cma_release() and cma_get_name()
authorMaxime Ripard <mripard@kernel.org>
Tue, 31 Mar 2026 10:00:14 +0000 (12:00 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 31 Mar 2026 11:27:21 +0000 (13:27 +0200)
The CMA dma-buf heap uses cma_alloc() and cma_release() to allocate and
free, respectively, its CMA buffers, and cma_get_name() to get the name
of the heap instance it's going to create.

However, these functions are not exported. Since we want to turn the CMA
heap into a module, let's export them both.

Reviewed-by: T.J. Mercier <tjmercier@google.com>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20260331-dma-buf-heaps-as-modules-v4-5-e18fda504419@kernel.org
mm/cma.c

index 94b5da468a7d719e5144d33b06bcc7619c0fbcc9..550effb9c4e01cc488b5744fe61d55a5b70a6d6c 100644 (file)
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -52,6 +52,7 @@ const char *cma_get_name(const struct cma *cma)
 {
        return cma->name;
 }
+EXPORT_SYMBOL_GPL(cma_get_name);
 
 static unsigned long cma_bitmap_aligned_mask(const struct cma *cma,
                                             unsigned int align_order)
@@ -951,6 +952,7 @@ struct page *cma_alloc(struct cma *cma, unsigned long count,
 
        return page;
 }
+EXPORT_SYMBOL_GPL(cma_alloc);
 
 static struct cma_memrange *find_cma_memrange(struct cma *cma,
                const struct page *pages, unsigned long count)
@@ -1027,6 +1029,7 @@ bool cma_release(struct cma *cma, const struct page *pages,
 
        return true;
 }
+EXPORT_SYMBOL_GPL(cma_release);
 
 bool cma_release_frozen(struct cma *cma, const struct page *pages,
                unsigned long count)