dma-direct: make dma_direct_{alloc,free} available to other implementations

So that they don't need to indirect through the operation vector.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Vladimir Murzin <[email protected]>
This commit is contained in:
Christoph Hellwig 2017-12-23 13:46:06 +01:00
commit 19dca8c0ef
3 changed files with 11 additions and 9 deletions

View file

@ -40,8 +40,8 @@ static bool dma_coherent_ok(struct device *dev, phys_addr_t phys, size_t size)
return phys_to_dma(dev, phys) + size - 1 <= dev->coherent_dma_mask;
}
static void *dma_direct_alloc(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs)
void *dma_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
gfp_t gfp, unsigned long attrs)
{
unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
int page_order = get_order(size);
@ -84,7 +84,7 @@ again:
return page_address(page);
}
static void dma_direct_free(struct device *dev, size_t size, void *cpu_addr,
void dma_direct_free(struct device *dev, size_t size, void *cpu_addr,
dma_addr_t dma_addr, unsigned long attrs)
{
unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;