diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2009-01-05 09:47:28 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-06 08:06:56 -0500 |
commit | d7dff84053524186b139342ac66a4160ce6bb517 (patch) | |
tree | 504ba7cc335158fed360d32bec3baf834cafbbce /arch/x86/kernel/pci-gart_64.c | |
parent | 33feffd4525fc2e4dd0a322fb5d07d61f85d791e (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/kernel/pci-gart_64.c')
-rw-r--r-- | arch/x86/kernel/pci-gart_64.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index e49c6dd0e8c6..9c557c0c928c 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
@@ -275,13 +275,6 @@ static dma_addr_t gart_map_page(struct device *dev, struct page *page, | |||
275 | return bus; | 275 | return bus; |
276 | } | 276 | } |
277 | 277 | ||
278 | static dma_addr_t gart_map_single(struct device *dev, phys_addr_t paddr, | ||
279 | size_t size, int dir) | ||
280 | { | ||
281 | return gart_map_page(dev, pfn_to_page(paddr >> PAGE_SHIFT), | ||
282 | paddr & ~PAGE_MASK, size, dir, NULL); | ||
283 | } | ||
284 | |||
285 | /* | 278 | /* |
286 | * Free a DMA mapping. | 279 | * Free a DMA mapping. |
287 | */ | 280 | */ |
@@ -306,12 +299,6 @@ static void gart_unmap_page(struct device *dev, dma_addr_t dma_addr, | |||
306 | free_iommu(iommu_page, npages); | 299 | free_iommu(iommu_page, npages); |
307 | } | 300 | } |
308 | 301 | ||
309 | static void gart_unmap_single(struct device *dev, dma_addr_t dma_addr, | ||
310 | size_t size, int direction) | ||
311 | { | ||
312 | gart_unmap_page(dev, dma_addr, size, direction, NULL); | ||
313 | } | ||
314 | |||
315 | /* | 302 | /* |
316 | * Wrapper for pci_unmap_single working with scatterlists. | 303 | * Wrapper for pci_unmap_single working with scatterlists. |
317 | */ | 304 | */ |
@@ -324,7 +311,7 @@ gart_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, int dir) | |||
324 | for_each_sg(sg, s, nents, i) { | 311 | for_each_sg(sg, s, nents, i) { |
325 | if (!s->dma_length || !s->length) | 312 | if (!s->dma_length || !s->length) |
326 | break; | 313 | break; |
327 | gart_unmap_single(dev, s->dma_address, s->dma_length, dir); | 314 | gart_unmap_page(dev, s->dma_address, s->dma_length, dir, NULL); |
328 | } | 315 | } |
329 | } | 316 | } |
330 | 317 | ||
@@ -538,7 +525,7 @@ static void | |||
538 | gart_free_coherent(struct device *dev, size_t size, void *vaddr, | 525 | gart_free_coherent(struct device *dev, size_t size, void *vaddr, |
539 | dma_addr_t dma_addr) | 526 | dma_addr_t dma_addr) |
540 | { | 527 | { |
541 | gart_unmap_single(dev, dma_addr, size, DMA_BIDIRECTIONAL); | 528 | gart_unmap_page(dev, dma_addr, size, DMA_BIDIRECTIONAL, NULL); |
542 | free_pages((unsigned long)vaddr, get_order(size)); | 529 | free_pages((unsigned long)vaddr, get_order(size)); |
543 | } | 530 | } |
544 | 531 | ||
@@ -725,8 +712,6 @@ static __init int init_k8_gatt(struct agp_kern_info *info) | |||
725 | } | 712 | } |
726 | 713 | ||
727 | static struct dma_mapping_ops gart_dma_ops = { | 714 | static struct dma_mapping_ops gart_dma_ops = { |
728 | .map_single = gart_map_single, | ||
729 | .unmap_single = gart_unmap_single, | ||
730 | .map_sg = gart_map_sg, | 715 | .map_sg = gart_map_sg, |
731 | .unmap_sg = gart_unmap_sg, | 716 | .unmap_sg = gart_unmap_sg, |
732 | .map_page = gart_map_page, | 717 | .map_page = gart_map_page, |