]> git.alsa-project.org Git - alsa-utils.git/commitdiff
pre-process-object: set tlv name if config exists already
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Tue, 15 Jun 2021 23:25:11 +0000 (16:25 -0700)
committerJaroslav Kysela <perex@perex.cz>
Mon, 23 Aug 2021 14:49:56 +0000 (16:49 +0200)
Do not create TLV config if it exists already. Just
set the string value with the name name.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/pre-process-object.c

index 43f8930d07bc50299decc8ea41f7ef1d31faccd5..1baa9b63887629b98a72e2e28ced9d2c2a36dce5 100644 (file)
@@ -118,12 +118,16 @@ int tplg_parent_update(struct tplg_pre_processor *tplg_pp, snd_config_t *parent,
 
        /* get section config */
        if (!strcmp(section_name, "tlv")) {
-               ret = tplg_config_make_add(&item_config, section_name,
-                                         SND_CONFIG_TYPE_STRING, cfg);
-               if (ret < 0) {
-                       SNDERR("Error creating section config widget %s for %s\n",
-                              section_name, parent_name);
-                       return ret;
+               /* set tlv name if config exists already */
+               ret = snd_config_search(cfg, section_name, &item_config);
+                       if (ret < 0) {
+                       ret = tplg_config_make_add(&item_config, section_name,
+                                                 SND_CONFIG_TYPE_STRING, cfg);
+                       if (ret < 0) {
+                               SNDERR("Error creating section config widget %s for %s\n",
+                                      section_name, parent_name);
+                               return ret;
+                       }
                }
 
                return snd_config_set_string(item_config, item_name);