diff options
Diffstat (limited to 'arch/sparc/kernel/dma.c')
-rw-r--r-- | arch/sparc/kernel/dma.c | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/arch/sparc/kernel/dma.c b/arch/sparc/kernel/dma.c index b2fa3127f605..e1ba8ee21b9a 100644 --- a/arch/sparc/kernel/dma.c +++ b/arch/sparc/kernel/dma.c | |||
@@ -1,40 +1,13 @@ | |||
1 | /* dma.c: PCI and SBUS DMA accessors for 32-bit sparc. | ||
2 | * | ||
3 | * Copyright (C) 2008 David S. Miller <davem@davemloft.net> | ||
4 | */ | ||
5 | |||
6 | #include <linux/kernel.h> | 1 | #include <linux/kernel.h> |
7 | #include <linux/module.h> | 2 | #include <linux/module.h> |
8 | #include <linux/dma-mapping.h> | 3 | #include <linux/dma-mapping.h> |
9 | #include <linux/scatterlist.h> | 4 | #include <linux/dma-debug.h> |
10 | #include <linux/mm.h> | ||
11 | 5 | ||
12 | #ifdef CONFIG_PCI | 6 | #define PREALLOC_DMA_DEBUG_ENTRIES (1 << 15) |
13 | #include <linux/pci.h> | ||
14 | #endif | ||
15 | 7 | ||
16 | /* | 8 | static int __init dma_init(void) |
17 | * Return whether the given PCI device DMA address mask can be | ||
18 | * supported properly. For example, if your device can only drive the | ||
19 | * low 24-bits during PCI bus mastering, then you would pass | ||
20 | * 0x00ffffff as the mask to this function. | ||
21 | */ | ||
22 | int dma_supported(struct device *dev, u64 mask) | ||
23 | { | 9 | { |
24 | #ifdef CONFIG_PCI | 10 | dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES); |
25 | if (dev->bus == &pci_bus_type) | ||
26 | return 1; | ||
27 | #endif | ||
28 | return 0; | 11 | return 0; |
29 | } | 12 | } |
30 | EXPORT_SYMBOL(dma_supported); | 13 | fs_initcall(dma_init); |
31 | |||
32 | int dma_set_mask(struct device *dev, u64 dma_mask) | ||
33 | { | ||
34 | #ifdef CONFIG_PCI | ||
35 | if (dev->bus == &pci_bus_type) | ||
36 | return pci_set_dma_mask(to_pci_dev(dev), dma_mask); | ||
37 | #endif | ||
38 | return -EOPNOTSUPP; | ||
39 | } | ||
40 | EXPORT_SYMBOL(dma_set_mask); | ||