linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: dapm: Revert "use component prefix when checking widget names"
@ 2021-07-03 12:50 Richard Fitzgerald
  2021-07-05 16:50 ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Fitzgerald @ 2021-07-03 12:50 UTC (permalink / raw)
  To: broonie
  Cc: pierre-louis.bossart, rander.wang, shumingf, patches, alsa-devel,
	linux-kernel, Richard Fitzgerald

This reverts
commit ae4fc532244b ("ASoC: dapm: use component prefix when checking widget names")

That commit breaks all users of the snd_soc_component_*_pin() functions
because it results in the prefix being added twice. It also breaks code
that correctly uses the snd_soc_dapm_*_pin() functions.

Use the snd_soc_component_*_pin() functions if you want the component
prefix to be prepended automatically.

Use the raw snd_soc_dapm_*_pin() functions if the caller has the full
name that should be matched exactly.

Fixes: commit ae4fc532244b ("ASoC: dapm: use component prefix when checking widget names")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/soc/soc-dapm.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 91bf939d5233..1369a3fea911 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2528,20 +2528,9 @@ static struct snd_soc_dapm_widget *dapm_find_widget(
 {
 	struct snd_soc_dapm_widget *w;
 	struct snd_soc_dapm_widget *fallback = NULL;
-	char prefixed_pin[80];
-	const char *pin_name;
-	const char *prefix = soc_dapm_prefix(dapm);
-
-	if (prefix) {
-		snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s",
-			 prefix, pin);
-		pin_name = prefixed_pin;
-	} else {
-		pin_name = pin;
-	}
 
 	for_each_card_widgets(dapm->card, w) {
-		if (!strcmp(w->name, pin_name)) {
+		if (!strcmp(w->name, pin)) {
 			if (w->dapm == dapm)
 				return w;
 			else
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-28 23:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-03 12:50 [PATCH] ASoC: dapm: Revert "use component prefix when checking widget names" Richard Fitzgerald
2021-07-05 16:50 ` Mark Brown
2021-07-22  9:55   ` Richard Fitzgerald
2021-07-23 15:17     ` Richard Fitzgerald
2021-07-23 15:24       ` Mark Brown
2021-07-28 16:09     ` Mark Brown
2021-07-28 18:29       ` Richard Fitzgerald
2021-07-28 23:40         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).