topology: pre-process-object: dont create if section already exists

Skip creating section when it exists already.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Ranjani Sridharan 2021-06-13 09:18:39 -07:00 committed by Jaroslav Kysela
parent 3c81766242
commit c1f0ec46b4

View file

@ -880,16 +880,18 @@ int tplg_build_object_from_template(struct tplg_pre_processor *tplg_pp, snd_conf
*wtop = top;
} else {
*wtop = tplg_find_config(top, object_name);
if (!(*wtop)) {
ret = tplg_config_make_add(wtop, object_name, SND_CONFIG_TYPE_COMPOUND,
top);
if (ret < 0) {
SNDERR("Error creating config for %s\n", object_name);
return ret;
}
if (*wtop)
goto template;
ret = tplg_config_make_add(wtop, object_name, SND_CONFIG_TYPE_COMPOUND,
top);
if (ret < 0) {
SNDERR("Error creating config for %s\n", object_name);
return ret;
}
}
template:
/* create template config */
if (!map->template_items)
return 0;