dma-coherent: add documentation to new interfaces

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by Dmitry Baryshkov and committed by Ingo Molnar b6d4f7e3 8fa8b9fb

+28
+28
kernel/dma-coherent.c
··· 92 92 } 93 93 EXPORT_SYMBOL(dma_mark_declared_memory_occupied); 94 94 95 + /** 96 + * Try to allocate memory from the per-device coherent area. 97 + * 98 + * @dev: device from which we allocate memory 99 + * @size: size of requested memory area 100 + * @dma_handle: This will be filled with the correct dma handle 101 + * @ret: This pointer will be filled with the virtual address 102 + * to allocated area. 103 + * 104 + * This function should be only called from per-arch %dma_alloc_coherent() 105 + * to support allocation from per-device coherent memory pools. 106 + * 107 + * Returns 0 if dma_alloc_coherent should continue with allocating from 108 + * generic memory areas, or !0 if dma_alloc_coherent should return %ret. 109 + */ 95 110 int dma_alloc_from_coherent(struct device *dev, ssize_t size, 96 111 dma_addr_t *dma_handle, void **ret) 97 112 { ··· 126 111 return (mem != NULL); 127 112 } 128 113 114 + /** 115 + * Try to free the memory allocated from per-device coherent memory pool. 116 + * @dev: device from which the memory was allocated 117 + * @order: the order of pages allocated 118 + * @vaddr: virtual address of allocated pages 119 + * 120 + * This checks whether the memory was allocated from the per-device 121 + * coherent memory pool and if so, releases that memory. 122 + * 123 + * Returns 1 if we correctly released the memory, or 0 if 124 + * %dma_release_coherent() should proceed with releasing memory from 125 + * generic pools. 126 + */ 129 127 int dma_release_from_coherent(struct device *dev, int order, void *vaddr) 130 128 { 131 129 struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;