diff options
author | Christoph Hellwig <hch@lst.de> | 2015-09-09 18:39:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-10 16:29:01 -0400 |
commit | 452e06af1f0149b01201f94264d452cd7a95db7a (patch) | |
tree | c8bae903b45001869d4565c73d32a601e06070cf /arch/hexagon | |
parent | ee196371d5cb1942ebdccc16bdce389812aa265e (diff) |
dma-mapping: consolidate dma_set_mask
Almost everyone implements dma_set_mask the same way, although some time
that's hidden in ->set_dma_mask methods.
This patch consolidates those into a common implementation that either
calls ->set_dma_mask if present or otherwise uses the default
implementation. Some architectures used to only call ->set_dma_mask
after the initial checks, and those instance have been fixed to do the
full work. h8300 implemented dma_set_mask bogusly as a no-ops and has
been fixed.
Unfortunately some architectures overload unrelated semantics like changing
the dma_ops into it so we still need to allow for an architecture override
for now.
[jcmvbkbc@gmail.com: fix xtensa]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/hexagon')
-rw-r--r-- | arch/hexagon/include/asm/dma-mapping.h | 1 | ||||
-rw-r--r-- | arch/hexagon/kernel/dma.c | 11 |
2 files changed, 0 insertions, 12 deletions
diff --git a/arch/hexagon/include/asm/dma-mapping.h b/arch/hexagon/include/asm/dma-mapping.h index 36e8de710b32..268fde8a4575 100644 --- a/arch/hexagon/include/asm/dma-mapping.h +++ b/arch/hexagon/include/asm/dma-mapping.h | |||
@@ -45,7 +45,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) | |||
45 | 45 | ||
46 | #define HAVE_ARCH_DMA_SUPPORTED 1 | 46 | #define HAVE_ARCH_DMA_SUPPORTED 1 |
47 | extern int dma_supported(struct device *dev, u64 mask); | 47 | extern int dma_supported(struct device *dev, u64 mask); |
48 | extern int dma_set_mask(struct device *dev, u64 mask); | ||
49 | extern int dma_is_consistent(struct device *dev, dma_addr_t dma_handle); | 48 | extern int dma_is_consistent(struct device *dev, dma_addr_t dma_handle); |
50 | extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 49 | extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
51 | enum dma_data_direction direction); | 50 | enum dma_data_direction direction); |
diff --git a/arch/hexagon/kernel/dma.c b/arch/hexagon/kernel/dma.c index b74f9bae31a3..9e3ddf792bd3 100644 --- a/arch/hexagon/kernel/dma.c +++ b/arch/hexagon/kernel/dma.c | |||
@@ -44,17 +44,6 @@ int dma_supported(struct device *dev, u64 mask) | |||
44 | } | 44 | } |
45 | EXPORT_SYMBOL(dma_supported); | 45 | EXPORT_SYMBOL(dma_supported); |
46 | 46 | ||
47 | int dma_set_mask(struct device *dev, u64 mask) | ||
48 | { | ||
49 | if (!dev->dma_mask || !dma_supported(dev, mask)) | ||
50 | return -EIO; | ||
51 | |||
52 | *dev->dma_mask = mask; | ||
53 | |||
54 | return 0; | ||
55 | } | ||
56 | EXPORT_SYMBOL(dma_set_mask); | ||
57 | |||
58 | static struct gen_pool *coherent_pool; | 47 | static struct gen_pool *coherent_pool; |
59 | 48 | ||
60 | 49 | ||