All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: alsa-devel@alsa-project.org, patchwork-lst@pengutronix.de,
	Takashi Iwai <tiwai@suse.com>,
	kernel@pengutronix.de
Subject: [PATCH] Revert "ASoC: simple-card-utils: enable "label" on asoc_simple_card_parse_card_name"
Date: Tue, 29 Aug 2017 17:36:53 +0200	[thread overview]
Message-ID: <20170829153653.11766-1-l.stach@pengutronix.de> (raw)

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(-)

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

             reply	other threads:[~2017-08-29 15:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29 15:36 Lucas Stach [this message]
2017-08-29 23:53 ` [PATCH] Revert "ASoC: simple-card-utils: enable "label" on asoc_simple_card_parse_card_name" Kuninori Morimoto
2017-08-29 23:57   ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170829153653.11766-1-l.stach@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=patchwork-lst@pengutronix.de \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.