Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma-buf: dma-heap: Provide accessor to get heap name

It can be useful to access the name for the heap,
so provide an accessor to do so.

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Liam Mark <lmark@codeaurora.org>
Cc: Chris Goldsworthy <cgoldswo@codeaurora.org>
Cc: Laura Abbott <labbott@kernel.org>
Cc: Brian Starkey <Brian.Starkey@arm.com>
Cc: Hridya Valsaraju <hridya@google.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Sandeep Patil <sspatil@google.com>
Cc: Daniel Mentz <danielmentz@google.com>
Cc: Ørjan Eide <orjan.eide@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Ezequiel Garcia <ezequiel@collabora.com>
Cc: Simon Ser <contact@emersion.fr>
Cc: James Jones <jajones@nvidia.com>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz <john.stultz@linaro.org>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210209194818.2459062-1-john.stultz@linaro.org

authored by

John Stultz and committed by
Sumit Semwal
98cd02da ad2c28bd

+21
+12
drivers/dma-buf/dma-heap.c
··· 202 202 return heap->priv; 203 203 } 204 204 205 + /** 206 + * dma_heap_get_name() - get heap name 207 + * @heap: DMA-Heap to retrieve private data for 208 + * 209 + * Returns: 210 + * The char* for the heap name. 211 + */ 212 + const char *dma_heap_get_name(struct dma_heap *heap) 213 + { 214 + return heap->name; 215 + } 216 + 205 217 struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) 206 218 { 207 219 struct dma_heap *heap, *h, *err_ret;
+9
include/linux/dma-heap.h
··· 51 51 void *dma_heap_get_drvdata(struct dma_heap *heap); 52 52 53 53 /** 54 + * dma_heap_get_name() - get heap name 55 + * @heap: DMA-Heap to retrieve private data for 56 + * 57 + * Returns: 58 + * The char* for the heap name. 59 + */ 60 + const char *dma_heap_get_name(struct dma_heap *heap); 61 + 62 + /** 54 63 * dma_heap_add - adds a heap to dmabuf heaps 55 64 * @exp_info: information needed to register this heap 56 65 */