diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2009-01-05 09:59:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-06 08:06:58 -0500 |
commit | f98eee8ea99fe74ee9c4e867ba178ec3072793be (patch) | |
tree | 67843fb8a25630dfdaaac8471423a9682cb0c390 /arch | |
parent | 160c1d8e40866edfeae7d68816b7005d70acf391 (diff) |
x86, ia64: remove duplicated swiotlb code
This adds swiotlb_map_page and swiotlb_unmap_page to lib/swiotlb.c and
remove IA64 and X86's swiotlb_map_page and swiotlb_unmap_page.
This also removes unnecessary swiotlb_map_single, swiotlb_map_single_attrs,
swiotlb_unmap_single and swiotlb_unmap_single_attrs.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/kernel/pci-swiotlb.c | 16 | ||||
-rw-r--r-- | arch/x86/kernel/pci-swiotlb_64.c | 17 |
2 files changed, 0 insertions, 33 deletions
diff --git a/arch/ia64/kernel/pci-swiotlb.c b/arch/ia64/kernel/pci-swiotlb.c index 6bf8f66786bd..e6b2ec9b27da 100644 --- a/arch/ia64/kernel/pci-swiotlb.c +++ b/arch/ia64/kernel/pci-swiotlb.c | |||
@@ -16,22 +16,6 @@ EXPORT_SYMBOL(swiotlb); | |||
16 | /* Set this to 1 if there is a HW IOMMU in the system */ | 16 | /* Set this to 1 if there is a HW IOMMU in the system */ |
17 | int iommu_detected __read_mostly; | 17 | int iommu_detected __read_mostly; |
18 | 18 | ||
19 | static dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, | ||
20 | unsigned long offset, size_t size, | ||
21 | enum dma_data_direction dir, | ||
22 | struct dma_attrs *attrs) | ||
23 | { | ||
24 | return swiotlb_map_single_attrs(dev, page_address(page) + offset, size, | ||
25 | dir, attrs); | ||
26 | } | ||
27 | |||
28 | static void swiotlb_unmap_page(struct device *dev, dma_addr_t dma_handle, | ||
29 | size_t size, enum dma_data_direction dir, | ||
30 | struct dma_attrs *attrs) | ||
31 | { | ||
32 | swiotlb_unmap_single_attrs(dev, dma_handle, size, dir, attrs); | ||
33 | } | ||
34 | |||
35 | struct dma_map_ops swiotlb_dma_ops = { | 19 | struct dma_map_ops swiotlb_dma_ops = { |
36 | .alloc_coherent = swiotlb_alloc_coherent, | 20 | .alloc_coherent = swiotlb_alloc_coherent, |
37 | .free_coherent = swiotlb_free_coherent, | 21 | .free_coherent = swiotlb_free_coherent, |
diff --git a/arch/x86/kernel/pci-swiotlb_64.c b/arch/x86/kernel/pci-swiotlb_64.c index 3f0d9924dd1c..5e32c4f6a7ba 100644 --- a/arch/x86/kernel/pci-swiotlb_64.c +++ b/arch/x86/kernel/pci-swiotlb_64.c | |||
@@ -38,23 +38,6 @@ int __weak swiotlb_arch_range_needs_mapping(void *ptr, size_t size) | |||
38 | return 0; | 38 | return 0; |
39 | } | 39 | } |
40 | 40 | ||
41 | /* these will be moved to lib/swiotlb.c later on */ | ||
42 | |||
43 | static dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, | ||
44 | unsigned long offset, size_t size, | ||
45 | enum dma_data_direction dir, | ||
46 | struct dma_attrs *attrs) | ||
47 | { | ||
48 | return swiotlb_map_single(dev, page_address(page) + offset, size, dir); | ||
49 | } | ||
50 | |||
51 | static void swiotlb_unmap_page(struct device *dev, dma_addr_t dma_handle, | ||
52 | size_t size, enum dma_data_direction dir, | ||
53 | struct dma_attrs *attrs) | ||
54 | { | ||
55 | swiotlb_unmap_single(dev, dma_handle, size, dir); | ||
56 | } | ||
57 | |||
58 | static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 41 | static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
59 | dma_addr_t *dma_handle, gfp_t flags) | 42 | dma_addr_t *dma_handle, gfp_t flags) |
60 | { | 43 | { |