aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRolf Eike Beer <eike-kernel@sf-tec.de>2006-09-29 04:59:48 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 12:18:10 -0400
commitd6bd3a39f7c6ebad49c261c3d458df974c880758 (patch)
treea5cf6054a8ff276f8d84ba94bb5df89ed5646332
parentd09d7ddf3018b4c6efa76dce72f6dec6054fa22b (diff)
[PATCH] Move valid_dma_direction() from x86_64 to generic code
As suggested by Muli Ben-Yehuda this function is moved to generic code as may be useful for all archs. [akpm@osdl.org: fix] Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de> Cc: Muli Ben-Yehuda <muli@il.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/x86_64/kernel/pci-swiotlb.c3
-rw-r--r--drivers/net/fec_8xx/fec_main.c2
-rw-r--r--drivers/net/fs_enet/fs_enet.h3
-rw-r--r--include/asm-x86_64/dma-mapping.h7
-rw-r--r--include/linux/dma-mapping.h7
5 files changed, 11 insertions, 11 deletions
diff --git a/arch/x86_64/kernel/pci-swiotlb.c b/arch/x86_64/kernel/pci-swiotlb.c
index 6a55f87ba97f..697f0aa794b9 100644
--- a/arch/x86_64/kernel/pci-swiotlb.c
+++ b/arch/x86_64/kernel/pci-swiotlb.c
@@ -3,7 +3,8 @@
3#include <linux/pci.h> 3#include <linux/pci.h>
4#include <linux/cache.h> 4#include <linux/cache.h>
5#include <linux/module.h> 5#include <linux/module.h>
6#include <asm/dma-mapping.h> 6#include <linux/dma-mapping.h>
7
7#include <asm/proto.h> 8#include <asm/proto.h>
8#include <asm/swiotlb.h> 9#include <asm/swiotlb.h>
9#include <asm/dma.h> 10#include <asm/dma.h>
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c
index 22ac2df1aeb0..e17a1449ee10 100644
--- a/drivers/net/fec_8xx/fec_main.c
+++ b/drivers/net/fec_8xx/fec_main.c
@@ -30,6 +30,7 @@
30#include <linux/mii.h> 30#include <linux/mii.h>
31#include <linux/ethtool.h> 31#include <linux/ethtool.h>
32#include <linux/bitops.h> 32#include <linux/bitops.h>
33#include <linux/dma-mapping.h>
33 34
34#include <asm/8xx_immap.h> 35#include <asm/8xx_immap.h>
35#include <asm/pgtable.h> 36#include <asm/pgtable.h>
@@ -37,7 +38,6 @@
37#include <asm/irq.h> 38#include <asm/irq.h>
38#include <asm/uaccess.h> 39#include <asm/uaccess.h>
39#include <asm/commproc.h> 40#include <asm/commproc.h>
40#include <asm/dma-mapping.h>
41 41
42#include "fec_8xx.h" 42#include "fec_8xx.h"
43 43
diff --git a/drivers/net/fs_enet/fs_enet.h b/drivers/net/fs_enet/fs_enet.h
index 95022c005f75..92590d8fc24b 100644
--- a/drivers/net/fs_enet/fs_enet.h
+++ b/drivers/net/fs_enet/fs_enet.h
@@ -6,11 +6,10 @@
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/list.h> 7#include <linux/list.h>
8#include <linux/phy.h> 8#include <linux/phy.h>
9#include <linux/dma-mapping.h>
9 10
10#include <linux/fs_enet_pd.h> 11#include <linux/fs_enet_pd.h>
11 12
12#include <asm/dma-mapping.h>
13
14#ifdef CONFIG_CPM1 13#ifdef CONFIG_CPM1
15#include <asm/commproc.h> 14#include <asm/commproc.h>
16 15
diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86_64/dma-mapping.h
index b6da83dcc7a6..10174b110a5c 100644
--- a/include/asm-x86_64/dma-mapping.h
+++ b/include/asm-x86_64/dma-mapping.h
@@ -55,13 +55,6 @@ extern dma_addr_t bad_dma_address;
55extern struct dma_mapping_ops* dma_ops; 55extern struct dma_mapping_ops* dma_ops;
56extern int iommu_merge; 56extern int iommu_merge;
57 57
58static inline int valid_dma_direction(int dma_direction)
59{
60 return ((dma_direction == DMA_BIDIRECTIONAL) ||
61 (dma_direction == DMA_TO_DEVICE) ||
62 (dma_direction == DMA_FROM_DEVICE));
63}
64
65static inline int dma_mapping_error(dma_addr_t dma_addr) 58static inline int dma_mapping_error(dma_addr_t dma_addr)
66{ 59{
67 if (dma_ops->mapping_error) 60 if (dma_ops->mapping_error)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 635690cf3e3d..ff203c465fed 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -24,6 +24,13 @@ enum dma_data_direction {
24#define DMA_28BIT_MASK 0x000000000fffffffULL 24#define DMA_28BIT_MASK 0x000000000fffffffULL
25#define DMA_24BIT_MASK 0x0000000000ffffffULL 25#define DMA_24BIT_MASK 0x0000000000ffffffULL
26 26
27static inline int valid_dma_direction(int dma_direction)
28{
29 return ((dma_direction == DMA_BIDIRECTIONAL) ||
30 (dma_direction == DMA_TO_DEVICE) ||
31 (dma_direction == DMA_FROM_DEVICE));
32}
33
27#include <asm/dma-mapping.h> 34#include <asm/dma-mapping.h>
28 35
29/* Backwards compat, remove in 2.7.x */ 36/* Backwards compat, remove in 2.7.x */