Skip to content

Commit 5af6389

Browse files
author
Christoph Hellwig
committed
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 <[email protected]>
1 parent 8df4051 commit 5af6389

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

arch/arm/mach-davinci/devices-da8xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ void __init da8xx_rproc_reserve_cma(void)
905905
__func__, ret);
906906
return;
907907
}
908-
dev_set_cma_area(&da8xx_dsp.dev, cma);
908+
da8xx_dsp.dev.cma_area = cma;
909909
rproc_mem_inited = true;
910910
}
911911
#else

include/linux/dma-contiguous.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ static inline struct cma *dev_get_cma_area(struct device *dev)
6666
return dma_contiguous_default_area;
6767
}
6868

69-
static inline void dev_set_cma_area(struct device *dev, struct cma *cma)
70-
{
71-
if (dev)
72-
dev->cma_area = cma;
73-
}
74-
7569
static inline void dma_contiguous_set_default(struct cma *cma)
7670
{
7771
dma_contiguous_default_area = cma;
@@ -97,8 +91,6 @@ static inline struct cma *dev_get_cma_area(struct device *dev)
9791
return NULL;
9892
}
9993

100-
static inline void dev_set_cma_area(struct device *dev, struct cma *cma) { }
101-
10294
static inline void dma_contiguous_set_default(struct cma *cma) { }
10395

10496
static inline void dma_contiguous_reserve(phys_addr_t limit) { }

kernel/dma/contiguous.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,14 +359,14 @@ void dma_free_contiguous(struct device *dev, struct page *page, size_t size)
359359

360360
static int rmem_cma_device_init(struct reserved_mem *rmem, struct device *dev)
361361
{
362-
dev_set_cma_area(dev, rmem->priv);
362+
dev->cma_area = rmem->priv;
363363
return 0;
364364
}
365365

366366
static void rmem_cma_device_release(struct reserved_mem *rmem,
367367
struct device *dev)
368368
{
369-
dev_set_cma_area(dev, NULL);
369+
dev->cma_area = NULL;
370370
}
371371

372372
static const struct reserved_mem_ops rmem_cma_ops = {

0 commit comments

Comments
 (0)