ASoC: generic: Card name parsing should be called after xxx_for_each_link()

"tidyup simple_util_parse_xxx() in xxx_parse_of()" commit changed the
function call order. But simple_util_parse_card_name() should be called
after dai_link settings, because it might use dai_link->name as card->name.

Fixes: fa6222d5e1 ("ASoC: audio-graph-card2: tidyup simple_util_parse_xxx() in audio_graph2_parse_of()")
Fixes: b8081307f5 ("ASoC: audio-graph-card: tidyup simple_util_parse_xxx() in audio_graph_parse_of()")
Fixes: 27ecf4da5a ("ASoC: simple-card: tidyup simple_util_parse_xxx() in simple_parse_of()")
Reported-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/b81ebfa2-6a35-4ff0-9d04-b867233eda4d@sirena.org.uk
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20260714103428.2318895-1-geert+renesas@glider.be
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/87zezt0zlw.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2026-07-15 02:13:15 +00:00 committed by Mark Brown
parent 567a5c8664
commit 73080a7976
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
3 changed files with 15 additions and 12 deletions

View File

@ -587,10 +587,6 @@ int audio_graph_parse_of(struct simple_util_priv *priv, struct device *dev)
if (ret < 0)
goto end;
ret = simple_util_parse_card_name(priv, NULL);
if (ret < 0)
goto err;
memset(li, 0, sizeof(*li));
ret = graph_for_each_link(priv, li,
graph_dai_link_of,
@ -598,6 +594,11 @@ int audio_graph_parse_of(struct simple_util_priv *priv, struct device *dev)
if (ret < 0)
goto err;
/* Card name should be set after graph_for_each_link() */
ret = simple_util_parse_card_name(priv, NULL);
if (ret < 0)
goto err;
snd_soc_card_set_drvdata(card, priv);
simple_util_debug_info(priv);

View File

@ -1344,10 +1344,6 @@ int audio_graph2_parse_of(struct simple_util_priv *priv, struct device *dev,
if (ret < 0)
goto end;
ret = simple_util_parse_card_name(priv, NULL);
if (ret < 0)
goto err;
ret = simple_util_parse_aux_devs(priv, NULL);
if (ret < 0)
goto err;
@ -1357,6 +1353,11 @@ int audio_graph2_parse_of(struct simple_util_priv *priv, struct device *dev,
if (ret < 0)
goto err;
/* Card name should be set after graph_for_each_link() */
ret = simple_util_parse_card_name(priv, NULL);
if (ret < 0)
goto err;
snd_soc_card_set_drvdata(card, priv);
if ((hooks) && (hooks)->hook_post) {

View File

@ -704,10 +704,6 @@ static int simple_parse_of(struct simple_util_priv *priv)
if (ret < 0)
goto end;
ret = simple_util_parse_card_name(priv, PREFIX);
if (ret < 0)
goto err;
ret = simple_util_parse_aux_devs(priv, PREFIX);
if (ret < 0)
goto err;
@ -720,6 +716,11 @@ static int simple_parse_of(struct simple_util_priv *priv)
if (ret < 0)
goto err;
/* Card name should be set after simple_for_each_link() */
ret = simple_util_parse_card_name(priv, PREFIX);
if (ret < 0)
goto err;
ret = simple_populate_aux(priv);
if (ret < 0)
goto err;