aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/pci-base_32.c7
-rw-r--r--include/asm-x86/dma-mapping.h8
-rw-r--r--include/asm-x86/dma-mapping_32.h6
-rw-r--r--include/asm-x86/dma-mapping_64.h8
4 files changed, 15 insertions, 14 deletions
diff --git a/arch/x86/kernel/pci-base_32.c b/arch/x86/kernel/pci-base_32.c
index cf4bb28dfc6a..7caf5c211f23 100644
--- a/arch/x86/kernel/pci-base_32.c
+++ b/arch/x86/kernel/pci-base_32.c
@@ -30,6 +30,12 @@ static int pci32_dma_map_sg(struct device *dev, struct scatterlist *sglist,
30 return nents; 30 return nents;
31} 31}
32 32
33/* Make sure we keep the same behaviour */
34static int pci32_map_error(dma_addr_t dma_addr)
35{
36 return 0;
37}
38
33static const struct dma_mapping_ops pci32_dma_ops = { 39static const struct dma_mapping_ops pci32_dma_ops = {
34 .map_single = pci32_map_single, 40 .map_single = pci32_map_single,
35 .unmap_single = NULL, 41 .unmap_single = NULL,
@@ -41,6 +47,7 @@ static const struct dma_mapping_ops pci32_dma_ops = {
41 .sync_single_range_for_device = NULL, 47 .sync_single_range_for_device = NULL,
42 .sync_sg_for_cpu = NULL, 48 .sync_sg_for_cpu = NULL,
43 .sync_sg_for_device = NULL, 49 .sync_sg_for_device = NULL,
50 .mapping_error = pci32_map_error,
44}; 51};
45 52
46const struct dma_mapping_ops *dma_ops = &pci32_dma_ops; 53const struct dma_mapping_ops *dma_ops = &pci32_dma_ops;
diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h
index 984935d86bbd..a7090bbb2a2d 100644
--- a/include/asm-x86/dma-mapping.h
+++ b/include/asm-x86/dma-mapping.h
@@ -54,6 +54,14 @@ struct dma_mapping_ops {
54 54
55extern const struct dma_mapping_ops *dma_ops; 55extern const struct dma_mapping_ops *dma_ops;
56 56
57static inline int dma_mapping_error(dma_addr_t dma_addr)
58{
59 if (dma_ops->mapping_error)
60 return dma_ops->mapping_error(dma_addr);
61
62 return (dma_addr == bad_dma_address);
63}
64
57#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 65#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
58#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 66#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
59 67
diff --git a/include/asm-x86/dma-mapping_32.h b/include/asm-x86/dma-mapping_32.h
index d0512c9251b7..03a75f866534 100644
--- a/include/asm-x86/dma-mapping_32.h
+++ b/include/asm-x86/dma-mapping_32.h
@@ -8,12 +8,6 @@
8#include <asm/io.h> 8#include <asm/io.h>
9#include <asm/bug.h> 9#include <asm/bug.h>
10 10
11static inline int
12dma_mapping_error(dma_addr_t dma_addr)
13{
14 return 0;
15}
16
17extern int forbid_dac; 11extern int forbid_dac;
18 12
19static inline int 13static inline int
diff --git a/include/asm-x86/dma-mapping_64.h b/include/asm-x86/dma-mapping_64.h
index 352bf4164a5e..8353025f052d 100644
--- a/include/asm-x86/dma-mapping_64.h
+++ b/include/asm-x86/dma-mapping_64.h
@@ -3,14 +3,6 @@
3 3
4extern int iommu_merge; 4extern int iommu_merge;
5 5
6static inline int dma_mapping_error(dma_addr_t dma_addr)
7{
8 if (dma_ops->mapping_error)
9 return dma_ops->mapping_error(dma_addr);
10
11 return (dma_addr == bad_dma_address);
12}
13
14/* same for gart, swiotlb, and nommu */ 6/* same for gart, swiotlb, and nommu */
15static inline int dma_get_cache_alignment(void) 7static inline int dma_get_cache_alignment(void)
16{ 8{