Revert "ASoC: simple-card-utils: enable "label" on asoc_simple_card_parse_card_name"
diff mbox

Message ID 20170829153653.11766-1-l.stach@pengutronix.de
State New
Headers show

Commit Message

Lucas Stach Aug. 29, 2017, 3:36 p.m. UTC
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@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(-)

Comments

Kuninori Morimoto Aug. 29, 2017, 11:53 p.m. UTC | #1
Hi Lucas

> 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@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.

Sorry, but I don't understand your issue, and why it happens.
It tries to find "label" -> "[prefix]name" -> error.
The difference from previous version (tries "[prefix]name" -> error)
is just checking "label".
Do you know why it doesn't return error ?

Best regards
---
Kuninori Morimoto
Kuninori Morimoto Aug. 29, 2017, 11:57 p.m. UTC | #2
Hi Lucas, again

> > 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@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.
> 
> Sorry, but I don't understand your issue, and why it happens.
> It tries to find "label" -> "[prefix]name" -> error.
> The difference from previous version (tries "[prefix]name" -> error)
> is just checking "label".
> Do you know why it doesn't return error ?

I missed your fixup patch.
Sorry for my noise

Best regards
---
Kuninori Morimoto

Patch
diff mbox

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;