[alsa-devel] [PATCH] Revert "ASoC: simple-card-utils: enable "label" on asoc_simple_card_parse_card_name"

Lucas Stach l.stach at pengutronix.de
Tue Aug 29 17:36:53 CEST 2017


This commit breaks existing systems, as snd_soc_of_parse_card_name() doesn't
return an error if the DT name property is missing, which would be required
to hit the fallback path in the offending commit at all.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
This should be fixed properly, but given the timing with the 4.13 release
being really close, I opted for just reverting the offending commit.
---
 sound/soc/generic/simple-card-utils.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 7d7ab4aee42e..e6f472360cfc 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -125,21 +125,15 @@ EXPORT_SYMBOL_GPL(asoc_simple_card_set_dailink_name);
 int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
 				     char *prefix)
 {
+	char prop[128];
 	int ret;
 
-	if (!prefix)
-		prefix = "";
+	snprintf(prop, sizeof(prop), "%sname", prefix);
 
 	/* Parse the card name from DT */
-	ret = snd_soc_of_parse_card_name(card, "label");
-	if (ret < 0) {
-		char prop[128];
-
-		snprintf(prop, sizeof(prop), "%sname", prefix);
-		ret = snd_soc_of_parse_card_name(card, prop);
-		if (ret < 0)
-			return ret;
-	}
+	ret = snd_soc_of_parse_card_name(card, prop);
+	if (ret < 0)
+		return ret;
 
 	if (!card->name && card->dai_link)
 		card->name = card->dai_link->name;
-- 
2.11.0



More information about the Alsa-devel mailing list