Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-mapping: remove <asm-generic/dma-coherent.h>

This wasn't an asm-generic header to start with, and can be merged into
dma-mapping.h trivially.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Helge Deller <deller@gmx.de>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Steven Miao <realmz6@gmail.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Christoph Hellwig and committed by
Linus Torvalds
20d666e4 e1c7e324

+29 -42
-2
arch/xtensa/include/asm/dma-mapping.h
··· 13 13 #include <asm/cache.h> 14 14 #include <asm/io.h> 15 15 16 - #include <asm-generic/dma-coherent.h> 17 - 18 16 #include <linux/mm.h> 19 17 #include <linux/scatterlist.h> 20 18
+1 -2
drivers/base/dma-mapping.c
··· 12 12 #include <linux/gfp.h> 13 13 #include <linux/slab.h> 14 14 #include <linux/vmalloc.h> 15 - #include <asm-generic/dma-coherent.h> 16 15 17 16 /* 18 17 * Managed DMA API ··· 166 167 } 167 168 EXPORT_SYMBOL(dmam_free_noncoherent); 168 169 169 - #ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 170 + #ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT 170 171 171 172 static void dmam_coherent_decl_release(struct device *dev, void *res) 172 173 {
-32
include/asm-generic/dma-coherent.h
··· 1 - #ifndef DMA_COHERENT_H 2 - #define DMA_COHERENT_H 3 - 4 - #ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT 5 - /* 6 - * These three functions are only for dma allocator. 7 - * Don't use them in device drivers. 8 - */ 9 - int dma_alloc_from_coherent(struct device *dev, ssize_t size, 10 - dma_addr_t *dma_handle, void **ret); 11 - int dma_release_from_coherent(struct device *dev, int order, void *vaddr); 12 - 13 - int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma, 14 - void *cpu_addr, size_t size, int *ret); 15 - /* 16 - * Standard interface 17 - */ 18 - #define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 19 - int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, 20 - dma_addr_t device_addr, size_t size, int flags); 21 - 22 - void dma_release_declared_memory(struct device *dev); 23 - 24 - void *dma_mark_declared_memory_occupied(struct device *dev, 25 - dma_addr_t device_addr, size_t size); 26 - #else 27 - #define dma_alloc_from_coherent(dev, size, handle, ret) (0) 28 - #define dma_release_from_coherent(dev, order, vaddr) (0) 29 - #define dma_mmap_from_coherent(dev, vma, vaddr, order, ret) (0) 30 - #endif 31 - 32 - #endif
+28 -6
include/linux/dma-mapping.h
··· 11 11 #include <linux/scatterlist.h> 12 12 #include <linux/kmemcheck.h> 13 13 #include <linux/bug.h> 14 - #include <asm-generic/dma-coherent.h> 15 14 16 15 /* 17 16 * A dma_addr_t can hold any valid DMA or bus address for the platform. ··· 85 86 { 86 87 return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; 87 88 } 89 + 90 + #ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT 91 + /* 92 + * These three functions are only for dma allocator. 93 + * Don't use them in device drivers. 94 + */ 95 + int dma_alloc_from_coherent(struct device *dev, ssize_t size, 96 + dma_addr_t *dma_handle, void **ret); 97 + int dma_release_from_coherent(struct device *dev, int order, void *vaddr); 98 + 99 + int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma, 100 + void *cpu_addr, size_t size, int *ret); 101 + #else 102 + #define dma_alloc_from_coherent(dev, size, handle, ret) (0) 103 + #define dma_release_from_coherent(dev, order, vaddr) (0) 104 + #define dma_mmap_from_coherent(dev, vma, vaddr, order, ret) (0) 105 + #endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */ 88 106 89 107 #ifdef CONFIG_HAS_DMA 90 108 #include <asm/dma-mapping.h> ··· 584 568 #define DMA_MEMORY_INCLUDES_CHILDREN 0x04 585 569 #define DMA_MEMORY_EXCLUSIVE 0x08 586 570 587 - #ifndef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 571 + #ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT 572 + int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, 573 + dma_addr_t device_addr, size_t size, int flags); 574 + void dma_release_declared_memory(struct device *dev); 575 + void *dma_mark_declared_memory_occupied(struct device *dev, 576 + dma_addr_t device_addr, size_t size); 577 + #else 588 578 static inline int 589 579 dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, 590 580 dma_addr_t device_addr, size_t size, int flags) ··· 609 587 { 610 588 return ERR_PTR(-EBUSY); 611 589 } 612 - #endif 590 + #endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */ 613 591 614 592 /* 615 593 * Managed DMA API ··· 622 600 dma_addr_t *dma_handle, gfp_t gfp); 623 601 extern void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr, 624 602 dma_addr_t dma_handle); 625 - #ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 603 + #ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT 626 604 extern int dmam_declare_coherent_memory(struct device *dev, 627 605 phys_addr_t phys_addr, 628 606 dma_addr_t device_addr, size_t size, 629 607 int flags); 630 608 extern void dmam_release_declared_memory(struct device *dev); 631 - #else /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */ 609 + #else /* CONFIG_HAVE_GENERIC_DMA_COHERENT */ 632 610 static inline int dmam_declare_coherent_memory(struct device *dev, 633 611 phys_addr_t phys_addr, dma_addr_t device_addr, 634 612 size_t size, gfp_t gfp) ··· 639 617 static inline void dmam_release_declared_memory(struct device *dev) 640 618 { 641 619 } 642 - #endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */ 620 + #endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */ 643 621 644 622 static inline void *dma_alloc_writecombine(struct device *dev, size_t size, 645 623 dma_addr_t *dma_addr, gfp_t gfp)