From aa583dd38fd8b94eef3c1e71486c690c1dfa7d5e Mon Sep 17 00:00:00 2001 From: Simon Xue Date: Fri, 8 Aug 2025 17:43:41 +0800 Subject: [PATCH] dma-buf: rk_heaps: rk_dma_heap_cma_setup is only meaningful when CONFIG_DMABUF_HEAPS_ROCKCHIP_CMA_HEAP is enabled Change-Id: I06c8413951508de11d40aa6f83b654e42f8c7a8e Signed-off-by: Simon Xue --- include/linux/rk-dma-heap.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/linux/rk-dma-heap.h b/include/linux/rk-dma-heap.h index 1d44bf139d72..01a1bb50de36 100644 --- a/include/linux/rk-dma-heap.h +++ b/include/linux/rk-dma-heap.h @@ -14,9 +14,16 @@ struct rk_dma_heap; -#if defined(CONFIG_DMABUF_HEAPS_ROCKCHIP) +#if IS_REACHABLE(CONFIG_DMABUF_HEAPS_ROCKCHIP_CMA_HEAP) int rk_dma_heap_cma_setup(void); +#else +static inline int rk_dma_heap_cma_setup(void) +{ + return -ENODEV; +} +#endif +#if defined(CONFIG_DMABUF_HEAPS_ROCKCHIP) /** * rk_dma_heap_set_dev - set heap dev dma param * @heap: DMA-Heap to retrieve private data for @@ -88,11 +95,6 @@ void rk_dma_heap_free_contig_pages(struct rk_dma_heap *heap, struct page *pages, size_t len, const char *name); #else -static inline int rk_dma_heap_cma_setup(void) -{ - return -ENODEV; -} - static inline int rk_dma_heap_set_dev(struct device *heap_dev) { return -ENODEV;