summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-11-22 15:58:19 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-11-22 15:58:19 +0000
commitfa9bdb574f4febb751848a685d9a9017e04e1d53 (patch)
tree8d7d22cac6315b77bb5f6e69f2409c7917b1907e
parent4a13312b4c9256ff4bc5eba83ac242448bf1cd4b (diff)
Fix error return value.
-rw-r--r--arch/mips/kernel/pci-dma.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/mips/kernel/pci-dma.c b/arch/mips/kernel/pci-dma.c
index de9cb90aa..3788ef997 100644
--- a/arch/mips/kernel/pci-dma.c
+++ b/arch/mips/kernel/pci-dma.c
@@ -1,6 +1,7 @@
/*
- *
- * Dynamic DMA mapping support.
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
*
* Copyright (C) 2000 Ani Joshi <ajoshi@unixbox.com>
* swiped from i386, and cloned for MIPS by Geert, polished by Ralf.
@@ -23,11 +24,13 @@ void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
ret = (void *) __get_free_pages(gfp, get_order(size));
if (ret != NULL) {
+ memset(ret, 0, size);
dma_cache_inv((unsigned long) ret, size);
*dma_handle = virt_to_bus(ret);
+ ret = KSEG1ADDR(ret);
}
- return KSEG1ADDR(ret);
+ return ret;
}
void pci_free_consistent(struct pci_dev *hwdev, size_t size,