提交 1b4a56cd 编写于 作者: L Lucas Stach 提交者: Mark Brown

ASoC: simple_card_utils: fix fallback when "label" property isn't present

snd_soc_of_parse_card_name() doesn't return an error if the requested
property isn't present, but silently fails to fill the card name. This can
not be changed, as it is a backwards compatibility measure itself.

We can not rely on the return value of this function alone, but must check
if the card name has been filled sucessfully when deciding to skip the
fallback path, which is in place for existing users.

Fixes: dedfaa1e (ASoC: simple-card-utils: enable "label" on
                     asoc_simple_card_parse_card_name)
Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
Acked-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 5771a8c0
...@@ -132,7 +132,7 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card, ...@@ -132,7 +132,7 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
/* Parse the card name from DT */ /* Parse the card name from DT */
ret = snd_soc_of_parse_card_name(card, "label"); ret = snd_soc_of_parse_card_name(card, "label");
if (ret < 0) { if (ret < 0 || !card->name) {
char prop[128]; char prop[128];
snprintf(prop, sizeof(prop), "%sname", prefix); snprintf(prop, sizeof(prop), "%sname", prefix);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册