dma: import linux/dma-direction.h to consolidate enum dma_data_direction
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 25 Aug 2017 15:50:17 +0000 (00:50 +0900)
committerTom Rini <trini@konsulko.com>
Tue, 12 Sep 2017 22:02:23 +0000 (18:02 -0400)
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 <yamada.masahiro@socionext.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
arch/arm/include/asm/dma-mapping.h
arch/nds32/include/asm/dma-mapping.h
arch/x86/include/asm/dma-mapping.h
drivers/ata/sata_dwc.c
drivers/ata/sata_dwc.h
drivers/mmc/uniphier-sd.c
include/linux/dma-direction.h [new file with mode: 0644]

index a5821f54e5670a185ea541013ec7e2359089db5b..287466800e4bfd4f1793e8a59d22ef65c86fbd8b 100644 (file)
@@ -8,13 +8,9 @@
 #ifndef __ASM_ARM_DMA_MAPPING_H
 #define __ASM_ARM_DMA_MAPPING_H
 
-#define        dma_mapping_error(x, y) 0
+#include <linux/dma-direction.h>
 
-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)
 {
index 25e5a1b6ec8a253803dd42bed8abd0bc6b3570e2..a627306ed852306fa0ffad8d9ff1c2f5001489ac 100644 (file)
@@ -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 <linux/dma-direction.h>
 
 static void *dma_alloc_coherent(size_t len, unsigned long *handle)
 {
index 7de4c08e36eab84edf01f2b5d44e40e67bf36d51..43073ad2524f63e7926672d97554e3c9d31d9cd5 100644 (file)
@@ -8,13 +8,9 @@
 #ifndef __ASM_X86_DMA_MAPPING_H
 #define __ASM_X86_DMA_MAPPING_H
 
-#define        dma_mapping_error(x, y) 0
+#include <linux/dma-direction.h>
 
-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)
 {
index a226ca2decb5977747c495878678e70182ab658b..2f3b2ddb411f13724f673bbb25ed710cec7216fd 100644 (file)
@@ -26,6 +26,7 @@
 #include <command.h>
 #include <pci.h>
 #include <asm/processor.h>
+#include <linux/dma-direction.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <malloc.h>
index e2d9e0c1fce8556690552d706bf07478bf607a71..17fb20cf437b1aca4794450e200b4e7231331de0 100644 (file)
@@ -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;
index e272b141532456ba1cb4a46db895a9ba6e52b944..721b75fddace1ba5254fe6c22d196378d7ffb998 100644 (file)
 #include <mmc.h>
 #include <dm.h>
 #include <linux/compat.h>
+#include <linux/dma-direction.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
 #include <asm/unaligned.h>
-#include <asm/dma-mapping.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/include/linux/dma-direction.h b/include/linux/dma-direction.h
new file mode 100644 (file)
index 0000000..95b6a82
--- /dev/null
@@ -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