Skip to content

Commit eba5799

Browse files
author
Jyri Sarha
committed
audio: mixer: Memory, blob, and fast_get allocs to module API
Allocate all memory, blob handlers, and fast_get() buffers through module API mod_alloc() and friends and remove all redundant rfree(), comp_data_blob_handler_free(), and fast_put() calls from module unload functions and init error branches. When resources are allocated through module API functions they are automatically freed when the module is unloaded. This simplifies error handling and unloading process. Signed-off-by: Jyri Sarha <[email protected]>
1 parent cb65c6a commit eba5799

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/audio/mixer/mixer.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <sof/common.h>
1515
#include <rtos/panic.h>
1616
#include <sof/ipc/msg.h>
17-
#include <rtos/alloc.h>
1817
#include <rtos/init.h>
1918
#include <sof/lib/uuid.h>
2019
#include <sof/list.h>
@@ -47,7 +46,7 @@ static int mixer_init(struct processing_module *mod)
4746

4847
comp_dbg(dev, "mixer_init()");
4948

50-
md = rzalloc(SOF_MEM_FLAG_USER, sizeof(*md));
49+
md = mod_zalloc(mod, sizeof(*md));
5150
if (!md)
5251
return -ENOMEM;
5352

@@ -61,13 +60,10 @@ static int mixer_init(struct processing_module *mod)
6160

6261
static int mixer_free(struct processing_module *mod)
6362
{
64-
struct mixer_data *md = module_get_private_data(mod);
6563
struct comp_dev *dev = mod->dev;
6664

6765
comp_dbg(dev, "mixer_free()");
6866

69-
rfree(md);
70-
7167
return 0;
7268
}
7369

0 commit comments

Comments
 (0)