mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-04-21 21:53:57 +00:00
dma-mapping: translate __GFP_NOFAIL to DMA_ATTR_NO_WARN
This allows all dma_map_ops instances to entirely rely on DMA_ATTR_NO_WARN going forward. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Robin Murphy <robin.murphy@arm.com>
This commit is contained in:
parent
79ac32a427
commit
7ed1d91a9e
1 changed files with 10 additions and 4 deletions
|
@ -558,9 +558,11 @@ static inline void dma_free_attrs(struct device *dev, size_t size,
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void *dma_alloc_coherent(struct device *dev, size_t size,
|
static inline void *dma_alloc_coherent(struct device *dev, size_t size,
|
||||||
dma_addr_t *dma_handle, gfp_t flag)
|
dma_addr_t *dma_handle, gfp_t gfp)
|
||||||
{
|
{
|
||||||
return dma_alloc_attrs(dev, size, dma_handle, flag, 0);
|
|
||||||
|
return dma_alloc_attrs(dev, size, dma_handle, gfp,
|
||||||
|
(gfp & __GFP_NOWARN) ? DMA_ATTR_NO_WARN : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void dma_free_coherent(struct device *dev, size_t size,
|
static inline void dma_free_coherent(struct device *dev, size_t size,
|
||||||
|
@ -794,8 +796,12 @@ static inline void dmam_release_declared_memory(struct device *dev)
|
||||||
static inline void *dma_alloc_wc(struct device *dev, size_t size,
|
static inline void *dma_alloc_wc(struct device *dev, size_t size,
|
||||||
dma_addr_t *dma_addr, gfp_t gfp)
|
dma_addr_t *dma_addr, gfp_t gfp)
|
||||||
{
|
{
|
||||||
return dma_alloc_attrs(dev, size, dma_addr, gfp,
|
unsigned long attrs = DMA_ATTR_NO_WARN;
|
||||||
DMA_ATTR_WRITE_COMBINE);
|
|
||||||
|
if (gfp & __GFP_NOWARN)
|
||||||
|
attrs |= DMA_ATTR_NO_WARN;
|
||||||
|
|
||||||
|
return dma_alloc_attrs(dev, size, dma_addr, gfp, attrs);
|
||||||
}
|
}
|
||||||
#ifndef dma_alloc_writecombine
|
#ifndef dma_alloc_writecombine
|
||||||
#define dma_alloc_writecombine dma_alloc_wc
|
#define dma_alloc_writecombine dma_alloc_wc
|
||||||
|
|
Loading…
Add table
Reference in a new issue