mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
drivers: dma-contiguous: clean source code and prepare for device tree
This patch cleans the initialization of dma contiguous framework. The all-in-one dma_declare_contiguous() function is now separated into dma_contiguous_reserve_area() which only steals the the memory from memblock allocator and dma_contiguous_add_device() function, which assigns given device to the specified reserved memory area. This improves the flexibility in defining contiguous memory areas and assigning device to them, because now it is possible to assign more than one device to the given contiguous memory area. Such split in initialization procedure is also required for upcoming device tree support. Signed-off-by: Marek Szyprowski <[email protected]> Acked-by: Kyungmin Park <[email protected]> Acked-by: Michal Nazarewicz <[email protected]> Acked-by: Tomasz Figa <[email protected]>
This commit is contained in:
parent
f7d8f1e9cb
commit
a254738039
6 changed files with 105 additions and 108 deletions
|
|
@ -1,28 +0,0 @@
|
|||
#ifndef ASM_DMA_CONTIGUOUS_H
|
||||
#define ASM_DMA_CONTIGUOUS_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_CMA
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/dma-contiguous.h>
|
||||
|
||||
static inline struct cma *dev_get_cma_area(struct device *dev)
|
||||
{
|
||||
if (dev && dev->cma_area)
|
||||
return dev->cma_area;
|
||||
return dma_contiguous_default_area;
|
||||
}
|
||||
|
||||
static inline void dev_set_cma_area(struct device *dev, struct cma *cma)
|
||||
{
|
||||
if (dev)
|
||||
dev->cma_area = cma;
|
||||
if (!dev && !dma_contiguous_default_area)
|
||||
dma_contiguous_default_area = cma;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Loading…
Reference in a new issue