summaryrefslogtreecommitdiffstats
path: root/include/linux/dma-mapping.h
diff options
context:
space:
mode:
authorRolf Eike Beer <eike-kernel@sf-tec.de>2006-09-29 01:59:48 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 09:18:10 -0700
commitd6bd3a39f7c6ebad49c261c3d458df974c880758 (patch)
treea5cf6054a8ff276f8d84ba94bb5df89ed5646332 /include/linux/dma-mapping.h
parentd09d7ddf3018b4c6efa76dce72f6dec6054fa22b (diff)
downloadlinux-stable-d6bd3a39f7c6ebad49c261c3d458df974c880758.tar.gz
linux-stable-d6bd3a39f7c6ebad49c261c3d458df974c880758.tar.bz2
linux-stable-d6bd3a39f7c6ebad49c261c3d458df974c880758.zip
[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>
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r--include/linux/dma-mapping.h7
1 files changed, 7 insertions, 0 deletions
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 {
#define DMA_28BIT_MASK 0x000000000fffffffULL
#define DMA_24BIT_MASK 0x0000000000ffffffULL
+static inline int valid_dma_direction(int dma_direction)
+{
+ return ((dma_direction == DMA_BIDIRECTIONAL) ||
+ (dma_direction == DMA_TO_DEVICE) ||
+ (dma_direction == DMA_FROM_DEVICE));
+}
+
#include <asm/dma-mapping.h>
/* Backwards compat, remove in 2.7.x */