Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa651e18 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dma-mapping: Remove exposure of dma_get_[base/size]"

parents 50c2dbd3 afa801ec
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -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,
+1 −6
Original line number Diff line number Diff line
@@ -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)