diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index 4627d4495228..d8b797458b69 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -280,6 +280,18 @@ struct device *dma_heap_get_dev(struct dma_heap *heap) } EXPORT_SYMBOL_GPL(dma_heap_get_dev); +/** + * dma_heap_get_name() - get heap name + * @heap: DMA-Heap to retrieve private data for + * + * Returns: + * The char* for the heap name. + */ +const char *dma_heap_get_name(struct dma_heap *heap) +{ + return heap->name; +} + struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) { struct dma_heap *heap, *err_ret; diff --git a/include/linux/dma-heap.h b/include/linux/dma-heap.h index cfd47a6b2b49..e8f0e92c27dd 100644 --- a/include/linux/dma-heap.h +++ b/include/linux/dma-heap.h @@ -61,6 +61,15 @@ void *dma_heap_get_drvdata(struct dma_heap *heap); */ struct device *dma_heap_get_dev(struct dma_heap *heap); +/** + * dma_heap_get_name() - get heap name + * @heap: DMA-Heap to retrieve private data for + * + * Returns: + * The char* for the heap name. + */ +const char *dma_heap_get_name(struct dma_heap *heap); + /** * dma_heap_add - adds a heap to dmabuf heaps * @exp_info: information needed to register this heap