mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
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 <hch@lst.de>
This commit is contained in:
parent
0a0f0d8be7
commit
8df4051232
@ -884,6 +884,7 @@ early_param("rproc_mem", early_rproc_mem);
|
|||||||
|
|
||||||
void __init da8xx_rproc_reserve_cma(void)
|
void __init da8xx_rproc_reserve_cma(void)
|
||||||
{
|
{
|
||||||
|
struct cma *cma;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!rproc_base || !rproc_size) {
|
if (!rproc_base || !rproc_size) {
|
||||||
@ -897,13 +898,16 @@ void __init da8xx_rproc_reserve_cma(void)
|
|||||||
pr_info("%s: reserving 0x%lx @ 0x%lx...\n",
|
pr_info("%s: reserving 0x%lx @ 0x%lx...\n",
|
||||||
__func__, rproc_size, (unsigned long)rproc_base);
|
__func__, rproc_size, (unsigned long)rproc_base);
|
||||||
|
|
||||||
ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0);
|
ret = dma_contiguous_reserve_area(rproc_size, rproc_base, 0, &cma,
|
||||||
if (ret)
|
true);
|
||||||
pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret);
|
if (ret) {
|
||||||
else
|
pr_err("%s: dma_contiguous_reserve_area failed %d\n",
|
||||||
|
__func__, ret);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dev_set_cma_area(&da8xx_dsp.dev, cma);
|
||||||
rproc_mem_inited = true;
|
rproc_mem_inited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
void __init da8xx_rproc_reserve_cma(void)
|
void __init da8xx_rproc_reserve_cma(void)
|
||||||
|
@ -83,31 +83,6 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base,
|
|||||||
phys_addr_t limit, struct cma **res_cma,
|
phys_addr_t limit, struct cma **res_cma,
|
||||||
bool fixed);
|
bool fixed);
|
||||||
|
|
||||||
/**
|
|
||||||
* dma_declare_contiguous() - reserve area for contiguous memory handling
|
|
||||||
* for particular device
|
|
||||||
* @dev: Pointer to device structure.
|
|
||||||
* @size: Size of the reserved memory.
|
|
||||||
* @base: Start address of the reserved memory (optional, 0 for any).
|
|
||||||
* @limit: End address of the reserved memory (optional, 0 for any).
|
|
||||||
*
|
|
||||||
* This function reserves memory for specified device. It should be
|
|
||||||
* called by board specific code when early allocator (memblock or bootmem)
|
|
||||||
* is still activate.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static inline int dma_declare_contiguous(struct device *dev, phys_addr_t size,
|
|
||||||
phys_addr_t base, phys_addr_t limit)
|
|
||||||
{
|
|
||||||
struct cma *cma;
|
|
||||||
int ret;
|
|
||||||
ret = dma_contiguous_reserve_area(size, base, limit, &cma, true);
|
|
||||||
if (ret == 0)
|
|
||||||
dev_set_cma_area(dev, cma);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
|
struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
|
||||||
unsigned int order, bool no_warn);
|
unsigned int order, bool no_warn);
|
||||||
bool dma_release_from_contiguous(struct device *dev, struct page *pages,
|
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
|
|||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline
|
|
||||||
int dma_declare_contiguous(struct device *dev, phys_addr_t size,
|
|
||||||
phys_addr_t base, phys_addr_t limit)
|
|
||||||
{
|
|
||||||
return -ENOSYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
|
struct page *dma_alloc_from_contiguous(struct device *dev, size_t count,
|
||||||
unsigned int order, bool no_warn)
|
unsigned int order, bool no_warn)
|
||||||
|
Loading…
Reference in New Issue
Block a user