From afa801ec6c7433167d00883ecb0763bad38622dc Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Tue, 15 Oct 2019 16:26:29 -0700 Subject: [PATCH] dma-mapping: Remove exposure of dma_get_[base/size] Now that dma_get_[base/size] are not needed by other drivers, remove the implementation of dma_get_size(), and limit the scope of dma_get_base() to its original visibility. Change-Id: I38d6024b43608743217ebfd44a35ccb4da714386 Signed-off-by: Isaac J. Manjarres --- include/linux/dma-mapping.h | 16 ---------------- kernel/dma/coherent.c | 7 +------ 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index ae12f8dc05a5..03154f892a56 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -803,31 +803,15 @@ static inline int dma_get_cache_alignment(void) } #ifdef CONFIG_DMA_DECLARE_COHERENT -struct dma_coherent_mem; int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, dma_addr_t device_addr, size_t size); -dma_addr_t dma_get_device_base(struct device *dev, - struct dma_coherent_mem *mem); -unsigned long dma_get_size(struct dma_coherent_mem *mem); #else -struct dma_coherent_mem {}; static inline int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, dma_addr_t device_addr, size_t size) { return -ENOSYS; } - -static inline dma_addr_t dma_get_device_base(struct device *dev, - struct dma_coherent_mem *mem) -{ - return 0; -} - -static inline unsigned long dma_get_size(struct dma_coherent_mem *mem) -{ - return 0; -} #endif /* CONFIG_DMA_DECLARE_COHERENT */ static inline void *dmam_alloc_coherent(struct device *dev, size_t size, diff --git a/kernel/dma/coherent.c b/kernel/dma/coherent.c index 19d788e03e71..545e3869b0e3 100644 --- a/kernel/dma/coherent.c +++ b/kernel/dma/coherent.c @@ -28,7 +28,7 @@ static inline struct dma_coherent_mem *dev_get_coherent_memory(struct device *de return NULL; } -dma_addr_t dma_get_device_base(struct device *dev, +static inline dma_addr_t dma_get_device_base(struct device *dev, struct dma_coherent_mem * mem) { if (mem->use_dev_dma_pfn_offset) @@ -37,11 +37,6 @@ dma_addr_t dma_get_device_base(struct device *dev, return mem->device_base; } -unsigned long dma_get_size(struct dma_coherent_mem *mem) -{ - return mem->size << PAGE_SHIFT; -} - static int dma_init_coherent_memory(phys_addr_t phys_addr, dma_addr_t device_addr, size_t size, struct dma_coherent_mem **mem)