aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/dma-mapping.h
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-01-05 09:47:28 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-06 08:06:56 -0500
commitd7dff84053524186b139342ac66a4160ce6bb517 (patch)
tree504ba7cc335158fed360d32bec3baf834cafbbce /arch/x86/include/asm/dma-mapping.h
parent33feffd4525fc2e4dd0a322fb5d07d61f85d791e (diff)
x86: remove map_single and unmap_single in struct dma_mapping_ops
This patch converts dma_map_single and dma_unmap_single to use map_page and unmap_page respectively and removes unnecessary map_single and unmap_single in struct dma_mapping_ops. This leaves intel-iommu's dma_map_single and dma_unmap_single since IA64 uses them. They will be removed after the unification. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/dma-mapping.h')
-rw-r--r--arch/x86/include/asm/dma-mapping.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index 3fe05046fb31..b81f82268a16 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -24,10 +24,6 @@ struct dma_mapping_ops {
24 dma_addr_t *dma_handle, gfp_t gfp); 24 dma_addr_t *dma_handle, gfp_t gfp);
25 void (*free_coherent)(struct device *dev, size_t size, 25 void (*free_coherent)(struct device *dev, size_t size,
26 void *vaddr, dma_addr_t dma_handle); 26 void *vaddr, dma_addr_t dma_handle);
27 dma_addr_t (*map_single)(struct device *hwdev, phys_addr_t ptr,
28 size_t size, int direction);
29 void (*unmap_single)(struct device *dev, dma_addr_t addr,
30 size_t size, int direction);
31 void (*sync_single_for_cpu)(struct device *hwdev, 27 void (*sync_single_for_cpu)(struct device *hwdev,
32 dma_addr_t dma_handle, size_t size, 28 dma_addr_t dma_handle, size_t size,
33 int direction); 29 int direction);
@@ -103,7 +99,9 @@ dma_map_single(struct device *hwdev, void *ptr, size_t size,
103 struct dma_mapping_ops *ops = get_dma_ops(hwdev); 99 struct dma_mapping_ops *ops = get_dma_ops(hwdev);
104 100
105 BUG_ON(!valid_dma_direction(direction)); 101 BUG_ON(!valid_dma_direction(direction));
106 return ops->map_single(hwdev, virt_to_phys(ptr), size, direction); 102 return ops->map_page(hwdev, virt_to_page(ptr),
103 (unsigned long)ptr & ~PAGE_MASK, size,
104 direction, NULL);
107} 105}
108 106
109static inline void 107static inline void
@@ -113,8 +111,8 @@ dma_unmap_single(struct device *dev, dma_addr_t addr, size_t size,
113 struct dma_mapping_ops *ops = get_dma_ops(dev); 111 struct dma_mapping_ops *ops = get_dma_ops(dev);
114 112
115 BUG_ON(!valid_dma_direction(direction)); 113 BUG_ON(!valid_dma_direction(direction));
116 if (ops->unmap_single) 114 if (ops->unmap_page)
117 ops->unmap_single(dev, addr, size, direction); 115 ops->unmap_page(dev, addr, size, direction, NULL);
118} 116}
119 117
120static inline int 118static inline int
@@ -221,8 +219,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
221 struct dma_mapping_ops *ops = get_dma_ops(dev); 219 struct dma_mapping_ops *ops = get_dma_ops(dev);
222 220
223 BUG_ON(!valid_dma_direction(direction)); 221 BUG_ON(!valid_dma_direction(direction));
224 return ops->map_single(dev, page_to_phys(page) + offset, 222 return ops->map_page(dev, page, offset, size, direction, NULL);
225 size, direction);
226} 223}
227 224
228static inline void dma_unmap_page(struct device *dev, dma_addr_t addr, 225static inline void dma_unmap_page(struct device *dev, dma_addr_t addr,