From: Masahiro Yamada Date: Fri, 25 Aug 2017 15:50:17 +0000 (+0900) Subject: dma: import linux/dma-direction.h to consolidate enum dma_data_direction X-Git-Tag: v2017.11-rc1~149 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b27af39935855c88ef2203dcfc1ff54e013237c4;p=oweals%2Fu-boot.git dma: import linux/dma-direction.h to consolidate enum dma_data_direction Import include/linux/dma-direction.h from Linux 4.13-rc7 and delete duplicated definitions of enum dma_data_direction. Signed-off-by: Masahiro Yamada Reviewed-by: Andy Shevchenko --- diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index a5821f54e5..287466800e 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -8,13 +8,9 @@ #ifndef __ASM_ARM_DMA_MAPPING_H #define __ASM_ARM_DMA_MAPPING_H -#define dma_mapping_error(x, y) 0 +#include -enum dma_data_direction { - DMA_BIDIRECTIONAL = 0, - DMA_TO_DEVICE = 1, - DMA_FROM_DEVICE = 2, -}; +#define dma_mapping_error(x, y) 0 static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) { diff --git a/arch/nds32/include/asm/dma-mapping.h b/arch/nds32/include/asm/dma-mapping.h index 25e5a1b6ec..a627306ed8 100644 --- a/arch/nds32/include/asm/dma-mapping.h +++ b/arch/nds32/include/asm/dma-mapping.h @@ -7,11 +7,7 @@ #ifndef __ASM_NDS_DMA_MAPPING_H #define __ASM_NDS_DMA_MAPPING_H -enum dma_data_direction { - DMA_BIDIRECTIONAL = 0, - DMA_TO_DEVICE = 1, - DMA_FROM_DEVICE = 2, -}; +#include static void *dma_alloc_coherent(size_t len, unsigned long *handle) { diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index 7de4c08e36..43073ad252 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h @@ -8,13 +8,9 @@ #ifndef __ASM_X86_DMA_MAPPING_H #define __ASM_X86_DMA_MAPPING_H -#define dma_mapping_error(x, y) 0 +#include -enum dma_data_direction { - DMA_BIDIRECTIONAL = 0, - DMA_TO_DEVICE = 1, - DMA_FROM_DEVICE = 2, -}; +#define dma_mapping_error(x, y) 0 static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) { diff --git a/drivers/ata/sata_dwc.c b/drivers/ata/sata_dwc.c index a226ca2dec..2f3b2ddb41 100644 --- a/drivers/ata/sata_dwc.c +++ b/drivers/ata/sata_dwc.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/ata/sata_dwc.h b/drivers/ata/sata_dwc.h index e2d9e0c1fc..17fb20cf43 100644 --- a/drivers/ata/sata_dwc.h +++ b/drivers/ata/sata_dwc.h @@ -401,13 +401,6 @@ struct ata_device { #endif }; -enum dma_data_direction { - DMA_BIDIRECTIONAL = 0, - DMA_TO_DEVICE = 1, - DMA_FROM_DEVICE = 2, - DMA_NONE = 3, -}; - struct ata_link { struct ata_port *ap; int pmp; diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c index e272b14153..721b75fdda 100644 --- a/drivers/mmc/uniphier-sd.c +++ b/drivers/mmc/uniphier-sd.c @@ -11,10 +11,10 @@ #include #include #include +#include #include #include #include -#include DECLARE_GLOBAL_DATA_PTR; diff --git a/include/linux/dma-direction.h b/include/linux/dma-direction.h new file mode 100644 index 0000000000..95b6a82f59 --- /dev/null +++ b/include/linux/dma-direction.h @@ -0,0 +1,13 @@ +#ifndef _LINUX_DMA_DIRECTION_H +#define _LINUX_DMA_DIRECTION_H +/* + * These definitions mirror those in pci.h, so they can be used + * interchangeably with their PCI_ counterparts. + */ +enum dma_data_direction { + DMA_BIDIRECTIONAL = 0, + DMA_TO_DEVICE = 1, + DMA_FROM_DEVICE = 2, + DMA_NONE = 3, +}; +#endif