@@ -295,12 +295,13 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
dai_link->dynamic = 1;
dai_link->dpcm_merged_format = 1;
+ snprintf(dai_name, sizeof(dai_name),
+ "fe.%pOFP.%s", cpus->of_node, cpus->dai_name);
+
ret = graph_parse_node(priv, cpu_ep, li, 1);
if (ret)
return ret;
- snprintf(dai_name, sizeof(dai_name),
- "fe.%pOFP.%s", cpus->of_node, cpus->dai_name);
/*
* In BE<->BE connections it is not required to create
* PCM devices at CPU end of the dai link and thus 'no_pcm'
@@ -325,13 +326,13 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
dai_link->no_pcm = 1;
dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup;
+ snprintf(dai_name, sizeof(dai_name),
+ "be.%pOFP.%s", codecs->of_node, codecs->dai_name);
+
ret = graph_parse_node(priv, codec_ep, li, 0);
if (ret < 0)
return ret;
- snprintf(dai_name, sizeof(dai_name),
- "be.%pOFP.%s", codecs->of_node, codecs->dai_name);
-
/* check "prefix" from top node */
port = of_get_parent(ep);
ports = of_get_parent(port);
@@ -371,6 +372,13 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
dev_dbg(dev, "link_of (%pOF)\n", cpu_ep);
+ /*
+ * next graph_parse_node() might remove cpus->dai_name.
+ * get dai_name before it.
+ */
+ snprintf(dai_name, sizeof(dai_name),
+ "%s-%s", cpus->dai_name, codecs->dai_name);
+
ret = graph_parse_node(priv, cpu_ep, li, 1);
if (ret < 0)
return ret;
@@ -379,8 +387,6 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
if (ret < 0)
return ret;
- snprintf(dai_name, sizeof(dai_name),
- "%s-%s", cpus->dai_name, codecs->dai_name);
ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name);
if (ret < 0)
return ret;