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)