File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -366,17 +366,17 @@ static const struct dma_heap_ops cma_heap_ops = {
366
366
.allocate = cma_heap_allocate ,
367
367
};
368
368
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 )
370
370
{
371
- struct cma_heap * cma_heap ;
372
371
struct dma_heap_export_info exp_info ;
372
+ struct cma_heap * cma_heap ;
373
373
374
374
cma_heap = kzalloc (sizeof (* cma_heap ), GFP_KERNEL );
375
375
if (!cma_heap )
376
376
return - ENOMEM ;
377
377
cma_heap -> cma = cma ;
378
378
379
- exp_info .name = cma_get_name ( cma ) ;
379
+ exp_info .name = name ;
380
380
exp_info .ops = & cma_heap_ops ;
381
381
exp_info .priv = cma_heap ;
382
382
@@ -394,12 +394,16 @@ static int __init __add_cma_heap(struct cma *cma, void *data)
394
394
static int __init add_default_cma_heap (void )
395
395
{
396
396
struct cma * default_cma = dev_get_cma_area (NULL );
397
- int ret = 0 ;
397
+ int ret ;
398
398
399
- if (default_cma )
400
- ret = __add_cma_heap ( default_cma , NULL ) ;
399
+ if (! default_cma )
400
+ return 0 ;
401
401
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 ;
403
407
}
404
408
module_init (add_default_cma_heap );
405
409
MODULE_DESCRIPTION ("DMA-BUF CMA Heap" );
You can’t perform that action at this time.
0 commit comments