Skip to content

Commit 2d0cad0

Browse files
committed
ASoC: core: Always store of_node when getting DAI link component
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: 2e1dbea ("ASoC: meson: use snd_soc_{of_}get_dlc()") Fixes: 3c8b586 ("ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()") Link: https://lore.kernel.org/r/Message-Id: <20230623-asoc-fix-meson-probe-v1-1-82b2c2ec5ca4@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent ed95983 commit 2d0cad0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sound/soc/soc-core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3262,6 +3262,8 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_
32623262
struct snd_soc_component *pos;
32633263
int ret = -EPROBE_DEFER;
32643264

3265+
dlc->of_node = args->np;
3266+
32653267
mutex_lock(&client_mutex);
32663268
for_each_component(pos) {
32673269
struct device_node *component_of_node = soc_component_to_node(pos);
@@ -3300,7 +3302,6 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_
33003302
id--;
33013303
}
33023304

3303-
dlc->of_node = args->np;
33043305
dlc->dai_name = dai->driver->name;
33053306
if (!dlc->dai_name)
33063307
dlc->dai_name = pos->name;

0 commit comments

Comments
 (0)