mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: core: Always store of_node when getting DAI link component
Date: Sun, 25 Jun 2023 23:54:29 +0000	[thread overview]
Message-ID: <87jzvrksi2.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <20230623-asoc-fix-meson-probe-v1-1-82b2c2ec5ca4@kernel.org>


Hi Mark

Thank you for the patch !

> The generic snd_soc_dai_get_dlc() contains a default translation function
> for DAI names which has factored out common code in a number of card
> drivers, resolving the dai_name and of_node either using a driver provided
> translation function or with a generic implementation. Unfortunately the
> of_node can't be set by the translation function since it currently doesn't
> have an interface to do that but snd_soc_dai_get_dlc() only initialises the
> of_node in the case where there is no translation function.
> 
> This breaks the Meson support after conversion to use the generic helpers
> since the DPCM cards for it check which component of the SoC is connected
> to each link by checking the compatible for the component and the Meson
> components provide a custom operation so don't use the generic code.
> 
> Fix this and potentially other cards by unconditionally storing the node in
> the dai_link_component, there shouldn't be a binding specific of_node
> selected since that's how we determine the translation function.
> 
> Fixes: 2e1dbea1f8a3 ("ASoC: meson: use snd_soc_{of_}get_dlc()")
> Fixes: 3c8b5861850c ("ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Yes, indeed.
But I think we want to set it under lock and if ret was no error case ?

----------
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index ab1f302ee078..5cc3f4cc9d1b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3375,7 +3375,6 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_
 				id--;
 			}
 
-			dlc->of_node	= args->np;
 			dlc->dai_name	= snd_soc_dai_name_get(dai);
 		} else if (ret) {
 			/*
@@ -3389,6 +3388,10 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_
 
 		break;
 	}
+
+	if (ret == 0)
+		dlc->of_node = args->np;
+
 	mutex_unlock(&client_mutex);
 	return ret;
 }
-----------

Thank you for your help !!

Best regards
---
Kuninori Morimoto

  parent reply	other threads:[~2023-06-25 23:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23 21:04 Mark Brown
2023-06-23 23:10 ` Mark Brown
2023-06-25 23:54 ` Kuninori Morimoto [this message]
2023-06-26 11:49   ` Mark Brown
2023-06-29 14:23     ` Mark Brown
2023-06-29 23:23       ` 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=87jzvrksi2.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®