Commit 4a09ab67 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven

m68k: Provide dma_alloc_attrs()/dma_free_attrs()

Since commit 0049fb26 ("OMAPFB: use
dma_alloc_attrs to allocate memory") we have one non-arch user of
dma_{alloc,free}_attrs().

Hence provide these functions, as wrappers around
dma_{alloc,free}_coherent().

Note that most architectures do it the other way around. But as so far
m68k doesn't support the attributes at all, our solution should generate
smaller code.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent a49f0d1e
...@@ -21,6 +21,22 @@ extern void *dma_alloc_coherent(struct device *, size_t, ...@@ -21,6 +21,22 @@ extern void *dma_alloc_coherent(struct device *, size_t,
extern void dma_free_coherent(struct device *, size_t, extern void dma_free_coherent(struct device *, size_t,
void *, dma_addr_t); void *, dma_addr_t);
static inline void *dma_alloc_attrs(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t flag,
struct dma_attrs *attrs)
{
/* attrs is not supported and ignored */
return dma_alloc_coherent(dev, size, dma_handle, flag);
}
static inline void dma_free_attrs(struct device *dev, size_t size,
void *cpu_addr, dma_addr_t dma_handle,
struct dma_attrs *attrs)
{
/* attrs is not supported and ignored */
dma_free_coherent(dev, size, cpu_addr, dma_handle);
}
static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
dma_addr_t *handle, gfp_t flag) dma_addr_t *handle, gfp_t flag)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment