Skip to contentSkip to conversation

alsa-lib: topology: fix usage of SND_TPLG_INDEX_ALL when checking routes

PATCH Applied Liam Girdwood 2 participants 2 messages Sep 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alsa-lib: topology: fix usage of SND_TPLG_INDEX_ALL when checking routes

Make sure SND_TPLG_INDEX_ALL is used correctly when checking routes so that connecting routes of different indexes does not emit any warnings.

---
 src/topology/dapm.c | 4 ++--
 src/topology/elem.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
src/topology/dapm.c +2 -2
index 66892a6..0ddbf96 100644
@@ -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);
 		}
src/topology/elem.c +1 -1
index 89a4ac9..9a7c7b7 100644
@@ -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;
 	}
Signature · 1 line
1.9.1
Applied
#1 lore raw
Quoted 5 lines · Liam Girdwood

Make sure SND_TPLG_INDEX_ALL is used correctly when checking routes so that connecting routes of different indexes does not emit any warnings.

Applied, thanks.

Takashi