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>
*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;