Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/audio/mixer/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <sof/common.h>
#include <rtos/panic.h>
#include <sof/ipc/msg.h>
#include <rtos/alloc.h>
#include <rtos/init.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
Expand Down Expand Up @@ -47,7 +46,7 @@ static int mixer_init(struct processing_module *mod)

comp_dbg(dev, "mixer_init()");

md = rzalloc(SOF_MEM_FLAG_USER, sizeof(*md));
md = mod_zalloc(mod, sizeof(*md));
if (!md)
return -ENOMEM;

Expand All @@ -66,7 +65,7 @@ static int mixer_free(struct processing_module *mod)

comp_dbg(dev, "mixer_free()");

rfree(md);
mod_free(mod, md);

return 0;
}
Expand Down
9 changes: 4 additions & 5 deletions src/audio/mixin_mixout/mixin_mixout.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <rtos/panic.h>
#include <sof/ipc/msg.h>
#include <sof/ipc/notification_pool.h>
#include <rtos/alloc.h>
#include <rtos/init.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
Expand Down Expand Up @@ -141,7 +140,7 @@ static int mixin_init(struct processing_module *mod)

comp_dbg(dev, "entry");

md = rzalloc(SOF_MEM_FLAG_USER, sizeof(*md));
md = mod_zalloc(mod, sizeof(*md));
if (!md)
return -ENOMEM;

Expand All @@ -168,7 +167,7 @@ static int mixout_init(struct processing_module *mod)

comp_dbg(dev, "entry");

mo_data = rzalloc(SOF_MEM_FLAG_USER, sizeof(*mo_data));
mo_data = mod_zalloc(mod, sizeof(*mo_data));
if (!mo_data)
return -ENOMEM;

Expand All @@ -184,14 +183,14 @@ static int mixin_free(struct processing_module *mod)
{
struct mixin_data *md = module_get_private_data(mod);

rfree(md);
mod_free(mod, md);

return 0;
}

static int mixout_free(struct processing_module *mod)
{
rfree(module_get_private_data(mod));
mod_free(mod, module_get_private_data(mod));

return 0;
}
Expand Down
18 changes: 8 additions & 10 deletions src/audio/mux/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <sof/audio/ipc-config.h>
#include <sof/common.h>
#include <sof/ipc/msg.h>
#include <rtos/alloc.h>
#include <rtos/init.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
Expand Down Expand Up @@ -94,22 +93,21 @@ static int mux_demux_common_init(struct processing_module *mod, enum sof_comp_ty
return -EINVAL;
}

cd = rzalloc(SOF_MEM_FLAG_USER,
sizeof(*cd) + MUX_BLOB_STREAMS_SIZE);
cd = mod_zalloc(mod, sizeof(*cd) + MUX_BLOB_STREAMS_SIZE);
if (!cd)
return -ENOMEM;

cd->model_handler = comp_data_blob_handler_new(dev);
cd->model_handler = mod_data_blob_handler_new(mod);
if (!cd->model_handler) {
comp_err(dev, "comp_data_blob_handler_new() failed.");
comp_err(dev, "mod_data_blob_handler_new() failed.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module data blob handler creation failed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we remove function names from prints, that refer to the function where the print is called, because that's already printed automatically. But I think it's ok to refer to other functions in prints like in this case - it refers to the function that has failed, not to the one, that's calling the print.

ret = -ENOMEM;
goto err;
}

module_data->private = cd;
ret = comp_init_data_blob(cd->model_handler, cfg->size, cfg->init_data);
if (ret < 0) {
comp_err(dev, "comp_init_data_blob() failed.");
comp_err(dev, "module data blob initialization failed.");
goto err_init;
}

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

err_init:
comp_data_blob_handler_free(cd->model_handler);
mod_data_blob_handler_free(mod, cd->model_handler);

err:
rfree(cd);
mod_free(mod, cd);
return ret;
}

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

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

comp_data_blob_handler_free(cd->model_handler);
rfree(cd);
mod_data_blob_handler_free(mod, cd->model_handler);
mod_free(mod, cd);
return 0;
}

Expand Down
Loading