]> git.alsa-project.org Git - alsa-lib.git/commitdiff
topology: fix usage of SND_TPLG_INDEX_ALL when checking routes
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>
Tue, 12 Sep 2017 20:47:42 +0000 (21:47 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 12 Sep 2017 20:53:00 +0000 (22:53 +0200)
Make sure SND_TPLG_INDEX_ALL is used correctly when checking routes so
that connecting routes of different indexes does not emit any warnings.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/topology/dapm.c
src/topology/elem.c

index 66892a660f9ace835a4c30bdacbdb3292032e767..0ddbf965207a0daab9b61de32c26e426e4f41c70 100644 (file)
@@ -279,7 +279,7 @@ int tplg_build_routes(snd_tplg_t *tplg)
 
                }
                if (!tplg_elem_lookup(&tplg->widget_list, route->sink,
-                       SND_TPLG_TYPE_DAPM_WIDGET, elem->index)) {
+                       SND_TPLG_TYPE_DAPM_WIDGET, SND_TPLG_INDEX_ALL)) {
                        SNDERR("warning: undefined sink widget/stream '%s'\n",
                                route->sink);
                }
@@ -302,7 +302,7 @@ int tplg_build_routes(snd_tplg_t *tplg)
 
                }
                if (!tplg_elem_lookup(&tplg->widget_list, route->source,
-                       SND_TPLG_TYPE_DAPM_WIDGET, elem->index)) {
+                       SND_TPLG_TYPE_DAPM_WIDGET, SND_TPLG_INDEX_ALL)) {
                        SNDERR("warning: Undefined source widget/stream '%s'\n",
                                route->source);
                }
index 89a4ac9f08125731949b874543e1e138cf62abc9..9a7c7b75f9b347e7f0fa111caace3ce68d9b23cf 100644 (file)
@@ -123,7 +123,7 @@ struct tplg_elem *tplg_elem_lookup(struct list_head *base, const char* id,
                        return elem;
                /* SND_TPLG_INDEX_ALL is the default value "0" and applicable
                   for all use cases */
-               if ((elem->index != SND_TPLG_INDEX_ALL)
+               if ((index != SND_TPLG_INDEX_ALL)
                        && (elem->index > index))
                        break;
        }