[PATCH 17/28] x86: adjust dma_free_coherent for i386

Glauber Costa
2008-04-08T16:20:59Z

We call unmap_single, if available.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
arch/x86/kernel/pci-dma_32.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/pci-dma_32.c b/arch/x86/kernel/pci-dma_32.c
index 78c7640..49166a4 100644
--- a/arch/x86/kernel/pci-dma_32.c
+++ b/arch/x86/kernel/pci-dma_32.c
@@ -84,6 +84,8 @@ void dma_free_coherent(struct device *dev, size_t size,
WARN_ON(irqs_disabled()); /* for portability */
if (dma_release_coherent(dev, order, vaddr))
return;
+ if (dma_ops->unmap_single)
+ dma_ops->unmap_single(dev, dma_handle, size, 0);
free_pages((unsigned long)vaddr, order);
}
EXPORT_SYMBOL(dma_free_coherent);
--
1.5.0.6