Skip to content

Commit 13f248f

Browse files
author
Jyri Sarha
committed
Audio: Mux: 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. Signed-off-by: Jyri Sarha <[email protected]>
1 parent 0e17e9e commit 13f248f

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/audio/mux/mux.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <sof/audio/ipc-config.h>
1212
#include <sof/common.h>
1313
#include <sof/ipc/msg.h>
14-
#include <rtos/alloc.h>
1514
#include <rtos/init.h>
1615
#include <sof/lib/uuid.h>
1716
#include <sof/list.h>
@@ -94,22 +93,21 @@ static int mux_demux_common_init(struct processing_module *mod, enum sof_comp_ty
9493
return -EINVAL;
9594
}
9695

97-
cd = rzalloc(SOF_MEM_FLAG_USER,
98-
sizeof(*cd) + MUX_BLOB_STREAMS_SIZE);
96+
cd = mod_zalloc(mod, sizeof(*cd) + MUX_BLOB_STREAMS_SIZE);
9997
if (!cd)
10098
return -ENOMEM;
10199

102-
cd->model_handler = comp_data_blob_handler_new(dev);
100+
cd->model_handler = mod_data_blob_handler_new(mod);
103101
if (!cd->model_handler) {
104-
comp_err(dev, "comp_data_blob_handler_new() failed.");
102+
comp_err(dev, "mod_data_blob_handler_new() failed.");
105103
ret = -ENOMEM;
106104
goto err;
107105
}
108106

109107
module_data->private = cd;
110108
ret = comp_init_data_blob(cd->model_handler, cfg->size, cfg->init_data);
111109
if (ret < 0) {
112-
comp_err(dev, "comp_init_data_blob() failed.");
110+
comp_err(dev, "module data blob initialization failed.");
113111
goto err_init;
114112
}
115113

@@ -119,10 +117,10 @@ static int mux_demux_common_init(struct processing_module *mod, enum sof_comp_ty
119117
return 0;
120118

121119
err_init:
122-
comp_data_blob_handler_free(cd->model_handler);
120+
mod_data_blob_handler_free(mod, cd->model_handler);
123121

124122
err:
125-
rfree(cd);
123+
mod_free(mod, cd);
126124
return ret;
127125
}
128126

@@ -139,8 +137,8 @@ static int mux_free(struct processing_module *mod)
139137

140138
comp_dbg(mod->dev, "mux_free()");
141139

142-
comp_data_blob_handler_free(cd->model_handler);
143-
rfree(cd);
140+
mod_data_blob_handler_free(mod, cd->model_handler);
141+
mod_free(mod, cd);
144142
return 0;
145143
}
146144

0 commit comments

Comments
 (0)