Skip to content

Commit 8df4051

Browse files
author
Christoph Hellwig
committed
dma-contiguous: remove dma_declare_contiguous
dma_declare_contiguous is a trivial wrapper around dma_contiguous_reserve_area and just has a single caller. Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 0a0f0d8 commit 8df4051

File tree

2 files changed

+10
-38
lines changed

2 files changed

+10
-38
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ early_param("rproc_mem", early_rproc_mem);
884884

885885
void __init da8xx_rproc_reserve_cma(void)
886886
{
887+
struct cma *cma;
887888
int ret;
888889

889890
if (!rproc_base || !rproc_size) {
@@ -897,13 +898,16 @@ void __init da8xx_rproc_reserve_cma(void)
897898
pr_info("%s: reserving 0x%lx @ 0x%lx...\n",
898899
__func__, rproc_size, (unsigned long)rproc_base);
899900

900-
ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0);
901-
if (ret)
902-
pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret);
903-
else
904-
rproc_mem_inited = true;
901+
ret = dma_contiguous_reserve_area(rproc_size, rproc_base, 0, &cma,
902+
true);
903+
if (ret) {
904+
pr_err("%s: dma_contiguous_reserve_area failed %d\n",
905+
__func__, ret);
906+
return;
907+
}
908+
dev_set_cma_area(&da8xx_dsp.dev, cma);
909+
rproc_mem_inited = true;
905910
}
906-
907911
#else
908912

909913
void __init da8xx_rproc_reserve_cma(void)

include/linux/dma-contiguous.h

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -83,31 +83,6 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base,
8383
phys_addr_t limit, struct cma **res_cma,
8484
bool fixed);
8585

86-
/**
87-
* dma_declare_contiguous() - reserve area for contiguous memory handling
88-
* for particular device
89-
* @dev: Pointer to device structure.
90-
* @size: Size of the reserved memory.
91-
* @base: Start address of the reserved memory (optional, 0 for any).
92-
* @limit: End address of the reserved memory (optional, 0 for any).
93-
*
94-
* This function reserves memory for specified device. It should be
95-
* called by board specific code when early allocator (memblock or bootmem)
96-
* is still activate.
97-
*/
98-
99-
static inline int dma_declare_contiguous(struct device *dev, phys_addr_t size,
100-
phys_addr_t base, phys_addr_t limit)
101-
{
102-
struct cma *cma;
103-
int ret;
104-
ret = dma_contiguous_reserve_area(size, base, limit, &cma, true);
105-
if (ret == 0)
106-
dev_set_cma_area(dev, cma);
107-
108-
return ret;
109-
}
110-
11186
struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
11287
unsigned int order, bool no_warn);
11388
bool dma_release_from_contiguous(struct device *dev, struct page *pages,
@@ -135,13 +110,6 @@ static inline int dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base
135110
return -ENOSYS;
136111
}
137112

138-
static inline
139-
int dma_declare_contiguous(struct device *dev, phys_addr_t size,
140-
phys_addr_t base, phys_addr_t limit)
141-
{
142-
return -ENOSYS;
143-
}
144-
145113
static inline
146114
struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
147115
unsigned int order, bool no_warn)

0 commit comments

Comments
 (0)