|
12 | 12 | #include <user/trace.h> |
13 | 13 | #include <sof/common.h> |
14 | 14 | #include <rtos/panic.h> |
15 | | -#include <rtos/alloc.h> |
16 | 15 | #include <rtos/init.h> |
17 | 16 | #include <sof/lib/uuid.h> |
18 | 17 | #include <sof/list.h> |
@@ -421,68 +420,48 @@ static int igo_nr_init(struct processing_module *mod) |
421 | 420 | return -EINVAL; |
422 | 421 | } |
423 | 422 |
|
424 | | - cd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*cd)); |
| 423 | + cd = mod_zalloc(mod, sizeof(*cd)); |
425 | 424 | if (!cd) |
426 | 425 | return -ENOMEM; |
427 | 426 |
|
428 | 427 | md->private = cd; |
429 | 428 | ret = IgoLibGetInfo(&cd->igo_lib_info); |
430 | 429 | if (ret != IGO_RET_OK) { |
431 | 430 | comp_err(dev, "IgoLibGetInfo() Failed."); |
432 | | - ret = -EINVAL; |
433 | | - goto cd_fail; |
| 431 | + return -EINVAL; |
434 | 432 | } |
435 | 433 |
|
436 | | - cd->p_handle = rballoc(SOF_MEM_FLAG_USER, cd->igo_lib_info.handle_size); |
| 434 | + cd->p_handle = mod_balloc(mod, cd->igo_lib_info.handle_size); |
437 | 435 | if (!cd->p_handle) { |
438 | | - comp_err(dev, "igo_handle memory rballoc error for size %d", |
| 436 | + comp_err(dev, "igo_handle memory mod_balloc error for size %d", |
439 | 437 | cd->igo_lib_info.handle_size); |
440 | | - ret = -ENOMEM; |
441 | | - goto cd_fail; |
| 438 | + return -ENOMEM; |
442 | 439 | } |
443 | 440 |
|
444 | 441 | /* Handler for configuration data */ |
445 | | - cd->model_handler = comp_data_blob_handler_new(dev); |
| 442 | + cd->model_handler = mod_data_blob_handler_new(mod); |
446 | 443 | if (!cd->model_handler) { |
447 | | - comp_err(dev, "comp_data_blob_handler_new() failed."); |
448 | | - ret = -ENOMEM; |
449 | | - goto cd_fail2; |
| 444 | + comp_err(dev, "mod_data_blob_handler_new() failed."); |
| 445 | + return -ENOMEM; |
450 | 446 | } |
451 | 447 |
|
452 | 448 | /* Get configuration data */ |
453 | 449 | ret = comp_init_data_blob(cd->model_handler, bs, cfg->data); |
454 | 450 | if (ret < 0) { |
455 | 451 | comp_err(dev, "comp_init_data_blob() failed."); |
456 | | - ret = -ENOMEM; |
457 | | - goto cd_fail3; |
| 452 | + return -ENOMEM; |
458 | 453 | } |
459 | 454 |
|
460 | 455 | /* update downstream (playback) or upstream (capture) buffer parameters */ |
461 | 456 | mod->verify_params_flags = BUFF_PARAMS_RATE; |
462 | 457 | comp_info(dev, "igo_nr created"); |
463 | 458 | return 0; |
464 | | - |
465 | | -cd_fail3: |
466 | | - comp_data_blob_handler_free(cd->model_handler); |
467 | | - |
468 | | -cd_fail2: |
469 | | - rfree(cd->p_handle); |
470 | | - |
471 | | -cd_fail: |
472 | | - rfree(cd); |
473 | | - return ret; |
474 | 459 | } |
475 | 460 |
|
476 | 461 | static int igo_nr_free(struct processing_module *mod) |
477 | 462 | { |
478 | | - struct comp_data *cd = module_get_private_data(mod); |
479 | | - |
480 | 463 | comp_info(mod->dev, "igo_nr_free()"); |
481 | 464 |
|
482 | | - comp_data_blob_handler_free(cd->model_handler); |
483 | | - |
484 | | - rfree(cd->p_handle); |
485 | | - rfree(cd); |
486 | 465 | return 0; |
487 | 466 | } |
488 | 467 |
|
|
0 commit comments