Skip to content

Commit 86e59cc

Browse files
rh-jkangassumitsemwal
authored andcommitted
dma-buf: heaps: Parameterize heap name in __add_cma_heap()
Prepare for the introduction of a fixed-name CMA heap by replacing the unused void pointer parameter in __add_cma_heap() with the heap name. Reviewed-by: Maxime Ripard <[email protected]> Acked-by: John Stultz <[email protected]> Signed-off-by: Jared Kangas <[email protected]> Signed-off-by: Sumit Semwal <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c2d636d commit 86e59cc

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

drivers/dma-buf/heaps/cma_heap.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,17 +366,17 @@ static const struct dma_heap_ops cma_heap_ops = {
366366
.allocate = cma_heap_allocate,
367367
};
368368

369-
static int __init __add_cma_heap(struct cma *cma, void *data)
369+
static int __init __add_cma_heap(struct cma *cma, const char *name)
370370
{
371-
struct cma_heap *cma_heap;
372371
struct dma_heap_export_info exp_info;
372+
struct cma_heap *cma_heap;
373373

374374
cma_heap = kzalloc(sizeof(*cma_heap), GFP_KERNEL);
375375
if (!cma_heap)
376376
return -ENOMEM;
377377
cma_heap->cma = cma;
378378

379-
exp_info.name = cma_get_name(cma);
379+
exp_info.name = name;
380380
exp_info.ops = &cma_heap_ops;
381381
exp_info.priv = cma_heap;
382382

@@ -394,12 +394,16 @@ static int __init __add_cma_heap(struct cma *cma, void *data)
394394
static int __init add_default_cma_heap(void)
395395
{
396396
struct cma *default_cma = dev_get_cma_area(NULL);
397-
int ret = 0;
397+
int ret;
398398

399-
if (default_cma)
400-
ret = __add_cma_heap(default_cma, NULL);
399+
if (!default_cma)
400+
return 0;
401401

402-
return ret;
402+
ret = __add_cma_heap(default_cma, cma_get_name(default_cma));
403+
if (ret)
404+
return ret;
405+
406+
return 0;
403407
}
404408
module_init(add_default_cma_heap);
405409
MODULE_DESCRIPTION("DMA-BUF CMA Heap");

0 commit comments

Comments
 (0)