dma-contiguous: remove dev_set_cma_area

dev_set_cma_area contains a trivial assignment.  It has just three
callers that all have a non-NULL device and depend on CONFIG_DMA_CMA,
so remove the wrapper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Christoph Hellwig 2020-09-11 10:56:03 +02:00
parent 8df4051232
commit 5af638931e
3 changed files with 3 additions and 11 deletions

View File

@ -905,7 +905,7 @@ void __init da8xx_rproc_reserve_cma(void)
__func__, ret); __func__, ret);
return; return;
} }
dev_set_cma_area(&da8xx_dsp.dev, cma); da8xx_dsp.dev.cma_area = cma;
rproc_mem_inited = true; rproc_mem_inited = true;
} }
#else #else

View File

@ -66,12 +66,6 @@ static inline struct cma *dev_get_cma_area(struct device *dev)
return dma_contiguous_default_area; return dma_contiguous_default_area;
} }
static inline void dev_set_cma_area(struct device *dev, struct cma *cma)
{
if (dev)
dev->cma_area = cma;
}
static inline void dma_contiguous_set_default(struct cma *cma) static inline void dma_contiguous_set_default(struct cma *cma)
{ {
dma_contiguous_default_area = cma; dma_contiguous_default_area = cma;
@ -97,8 +91,6 @@ static inline struct cma *dev_get_cma_area(struct device *dev)
return NULL; return NULL;
} }
static inline void dev_set_cma_area(struct device *dev, struct cma *cma) { }
static inline void dma_contiguous_set_default(struct cma *cma) { } static inline void dma_contiguous_set_default(struct cma *cma) { }
static inline void dma_contiguous_reserve(phys_addr_t limit) { } static inline void dma_contiguous_reserve(phys_addr_t limit) { }

View File

@ -359,14 +359,14 @@ void dma_free_contiguous(struct device *dev, struct page *page, size_t size)
static int rmem_cma_device_init(struct reserved_mem *rmem, struct device *dev) static int rmem_cma_device_init(struct reserved_mem *rmem, struct device *dev)
{ {
dev_set_cma_area(dev, rmem->priv); dev->cma_area = rmem->priv;
return 0; return 0;
} }
static void rmem_cma_device_release(struct reserved_mem *rmem, static void rmem_cma_device_release(struct reserved_mem *rmem,
struct device *dev) struct device *dev)
{ {
dev_set_cma_area(dev, NULL); dev->cma_area = NULL;
} }
static const struct reserved_mem_ops rmem_cma_ops = { static const struct reserved_mem_ops rmem_cma_ops = {