[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>
This commit is contained in:
Rolf Eike Beer 2006-09-29 01:59:48 -07:00 committed by Linus Torvalds
parent d09d7ddf30
commit d6bd3a39f7
5 changed files with 11 additions and 11 deletions

View File

@ -3,7 +3,8 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/module.h> #include <linux/module.h>
#include <asm/dma-mapping.h> #include <linux/dma-mapping.h>
#include <asm/proto.h> #include <asm/proto.h>
#include <asm/swiotlb.h> #include <asm/swiotlb.h>
#include <asm/dma.h> #include <asm/dma.h>

View File

@ -30,6 +30,7 @@
#include <linux/mii.h> #include <linux/mii.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/dma-mapping.h>
#include <asm/8xx_immap.h> #include <asm/8xx_immap.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
@ -37,7 +38,6 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/commproc.h> #include <asm/commproc.h>
#include <asm/dma-mapping.h>
#include "fec_8xx.h" #include "fec_8xx.h"

View File

@ -6,11 +6,10 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/dma-mapping.h>
#include <linux/fs_enet_pd.h> #include <linux/fs_enet_pd.h>
#include <asm/dma-mapping.h>
#ifdef CONFIG_CPM1 #ifdef CONFIG_CPM1
#include <asm/commproc.h> #include <asm/commproc.h>

View File

@ -55,13 +55,6 @@ extern dma_addr_t bad_dma_address;
extern struct dma_mapping_ops* dma_ops; extern struct dma_mapping_ops* dma_ops;
extern int iommu_merge; extern int iommu_merge;
static inline int valid_dma_direction(int dma_direction)
{
return ((dma_direction == DMA_BIDIRECTIONAL) ||
(dma_direction == DMA_TO_DEVICE) ||
(dma_direction == DMA_FROM_DEVICE));
}
static inline int dma_mapping_error(dma_addr_t dma_addr) static inline int dma_mapping_error(dma_addr_t dma_addr)
{ {
if (dma_ops->mapping_error) if (dma_ops->mapping_error)

View File

@ -24,6 +24,13 @@ enum dma_data_direction {
#define DMA_28BIT_MASK 0x000000000fffffffULL #define DMA_28BIT_MASK 0x000000000fffffffULL
#define DMA_24BIT_MASK 0x0000000000ffffffULL #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> #include <asm/dma-mapping.h>
/* Backwards compat, remove in 2.7.x */ /* Backwards compat, remove in 2.7.x */