Skip to content

Commit

Permalink
dma-mapping: remove dma_release_declared_memory
Browse files Browse the repository at this point in the history
This function is entirely unused given that declared memory is
generally provided by platform setup code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Christoph Hellwig committed Sep 4, 2019
1 parent 212836a commit 1fa0682
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
11 changes: 0 additions & 11 deletions Documentation/DMA-API.txt
Original file line number Diff line number Diff line change
Expand Up @@ -603,17 +603,6 @@ For reasons of efficiency, most platforms choose to track the declared
region only at the granularity of a page. For smaller allocations,
you should use the dma_pool() API.

::

void
dma_release_declared_memory(struct device *dev)

Remove the memory region previously declared from the system. This
API performs *no* in-use checking for this region and will return
unconditionally having removed all the required structures. It is the
driver's job to ensure that no parts of this memory region are
currently in use.

Part III - Debug drivers use of the DMA-API
-------------------------------------------

Expand Down
6 changes: 0 additions & 6 deletions include/linux/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -764,19 +764,13 @@ static inline int dma_get_cache_alignment(void)
#ifdef CONFIG_DMA_DECLARE_COHERENT
int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
dma_addr_t device_addr, size_t size);
void dma_release_declared_memory(struct device *dev);
#else
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 void
dma_release_declared_memory(struct device *dev)
{
}
#endif /* CONFIG_DMA_DECLARE_COHERENT */

static inline void *dmam_alloc_coherent(struct device *dev, size_t size,
Expand Down
11 changes: 0 additions & 11 deletions kernel/dma/coherent.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,6 @@ int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
}
EXPORT_SYMBOL(dma_declare_coherent_memory);

void dma_release_declared_memory(struct device *dev)
{
struct dma_coherent_mem *mem = dev->dma_mem;

if (!mem)
return;
dma_release_coherent_memory(mem);
dev->dma_mem = NULL;
}
EXPORT_SYMBOL(dma_release_declared_memory);

static void *__dma_alloc_from_coherent(struct dma_coherent_mem *mem,
ssize_t size, dma_addr_t *dma_handle)
{
Expand Down

0 comments on commit 1fa0682

Please sign in to comment.