Skip to content

Commit 2c3cd44

Browse files
committed
ipc4: helper: remove false warning
Function get_driver is once called just for checking if a component is already registered prior to registration. This leads to a false warning. This change fixes this by adding a separate function that does not issue the warning and replacing the warning with error. Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
1 parent 4fd12da commit 2c3cd44

File tree

1 file changed

+29
-20
lines changed

1 file changed

+29
-20
lines changed

src/ipc/ipc4/helper.c

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,9 +1126,8 @@ int ipc4_process_on_core(uint32_t core, bool blocking)
11261126
return IPC4_SUCCESS;
11271127
}
11281128

1129-
__cold static const struct comp_driver *ipc4_get_drv(const void *uuid)
1129+
__cold static const struct comp_driver *ipc4_search_for_drv(const void *uuid)
11301130
{
1131-
const struct sof_uuid *const __maybe_unused sof_uuid = (const struct sof_uuid *)uuid;
11321131
struct comp_driver_list *drivers = comp_drivers_get();
11331132
struct list_item *clist;
11341133
const struct comp_driver *drv = NULL;
@@ -1149,21 +1148,32 @@ __cold static const struct comp_driver *ipc4_get_drv(const void *uuid)
11491148
info->drv->type,
11501149
info->drv->tctx->uuid_p);
11511150
drv = info->drv;
1152-
goto out;
1151+
break;
11531152
}
11541153
}
11551154

1156-
tr_warn(&comp_tr,
1157-
"the provided UUID (%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x) can't be found!",
1158-
sof_uuid->a, sof_uuid->b, sof_uuid->c, sof_uuid->d[0], sof_uuid->d[1],
1159-
sof_uuid->d[2], sof_uuid->d[3], sof_uuid->d[4], sof_uuid->d[5], sof_uuid->d[6],
1160-
sof_uuid->d[7]);
1161-
1162-
out:
11631155
irq_local_enable(flags);
11641156
return drv;
11651157
}
11661158

1159+
__cold static const struct comp_driver *ipc4_get_drv(const void *uuid)
1160+
{
1161+
const struct sof_uuid *const __maybe_unused sof_uuid = (const struct sof_uuid *)uuid;
1162+
const struct comp_driver *drv;
1163+
1164+
assert_can_be_cold();
1165+
1166+
drv = ipc4_search_for_drv(uuid);
1167+
if (!drv)
1168+
tr_err(&comp_tr,
1169+
"the provided UUID (%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x) can't be found!",
1170+
sof_uuid->a, sof_uuid->b, sof_uuid->c, sof_uuid->d[0], sof_uuid->d[1],
1171+
sof_uuid->d[2], sof_uuid->d[3], sof_uuid->d[4], sof_uuid->d[5],
1172+
sof_uuid->d[6], sof_uuid->d[7]);
1173+
1174+
return drv;
1175+
}
1176+
11671177
/*
11681178
* Called from
11691179
* - ipc4_get_large_config_module_instance()
@@ -1174,7 +1184,6 @@ __cold static const struct comp_driver *ipc4_get_drv(const void *uuid)
11741184
__cold const struct comp_driver *ipc4_get_comp_drv(uint32_t module_id)
11751185
{
11761186
const struct sof_man_fw_desc *desc = NULL;
1177-
const struct comp_driver *drv;
11781187
const struct sof_man_module *mod;
11791188
uint32_t entry_index;
11801189

@@ -1223,18 +1232,18 @@ __cold const struct comp_driver *ipc4_get_comp_drv(uint32_t module_id)
12231232
return NULL;
12241233
#endif
12251234
}
1226-
/* Check already registered components */
1227-
drv = ipc4_get_drv(&mod->uuid);
12281235

12291236
#if CONFIG_LIBRARY_MANAGER
1230-
if (!drv) {
1231-
/* New module not registered yet. */
1232-
lib_manager_register_module(module_id);
1233-
drv = ipc4_get_drv(&mod->uuid);
1234-
}
1235-
#endif
1237+
/* Check already registered components */
1238+
const struct comp_driver *drv = ipc4_search_for_drv(&mod->uuid);
12361239

1237-
return drv;
1240+
if (drv)
1241+
return drv;
1242+
1243+
/* New module not registered yet. */
1244+
lib_manager_register_module(module_id);
1245+
#endif
1246+
return ipc4_get_drv(&mod->uuid);
12381247
}
12391248

12401249
struct comp_dev *ipc4_get_comp_dev(uint32_t comp_id)

0 commit comments

Comments
 (0)