diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2009-08-04 15:08:28 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-08-28 00:24:11 -0400 |
commit | 80d3e8abb73dad3983fef2597b52cab8fbcd876b (patch) | |
tree | 39d73950289a3de9cbdb2846da3d340374034ce4 /arch/powerpc/include/asm/dma-mapping.h | |
parent | 4a9a6bfe707cfe5bcb0a20eabe240293a095cd10 (diff) |
powerpc: Add CONFIG_DMA_API_DEBUG support
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/dma-mapping.h')
-rw-r--r-- | arch/powerpc/include/asm/dma-mapping.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 4bd41b4051e3..cb2ca41dd526 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h | |||
@@ -127,9 +127,15 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size, | |||
127 | dma_addr_t *dma_handle, gfp_t flag) | 127 | dma_addr_t *dma_handle, gfp_t flag) |
128 | { | 128 | { |
129 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 129 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
130 | void *cpu_addr; | ||
130 | 131 | ||
131 | BUG_ON(!dma_ops); | 132 | BUG_ON(!dma_ops); |
132 | return dma_ops->alloc_coherent(dev, size, dma_handle, flag); | 133 | |
134 | cpu_addr = dma_ops->alloc_coherent(dev, size, dma_handle, flag); | ||
135 | |||
136 | debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr); | ||
137 | |||
138 | return cpu_addr; | ||
133 | } | 139 | } |
134 | 140 | ||
135 | static inline void dma_free_coherent(struct device *dev, size_t size, | 141 | static inline void dma_free_coherent(struct device *dev, size_t size, |
@@ -138,6 +144,9 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
138 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 144 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
139 | 145 | ||
140 | BUG_ON(!dma_ops); | 146 | BUG_ON(!dma_ops); |
147 | |||
148 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); | ||
149 | |||
141 | dma_ops->free_coherent(dev, size, cpu_addr, dma_handle); | 150 | dma_ops->free_coherent(dev, size, cpu_addr, dma_handle); |
142 | } | 151 | } |
143 | 152 | ||