aboutsummaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorKuninori Morimoto2023-06-20 02:14:46 +0000
committerMark Brown2023-06-20 12:49:28 +0100
commit14c9b25f632b561be33af99942833a618811ac3d (patch)
treeb70dd831cda005646e3cd53eaa3632a199b0daa6 /sound/soc
parentdb588ea1a352df9673464b1bc6d4acb83f5e8256 (diff)
ASoC: soc-core.c: use snd_soc_{of_}get_dlc()
Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). But we now can use snd_soc_{of_}get_dlc() for it. Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87h6r2dgmi.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-core.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 7b13b1b232ef..f06a20773a34 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3402,26 +3402,6 @@ static int __snd_soc_of_get_dai_link_component_alloc(
return 0;
}
-static int __snd_soc_of_get_dai_link_component_parse(
- struct device_node *of_node,
- struct snd_soc_dai_link_component *component, int index)
-{
- struct of_phandle_args args;
- int ret;
-
- ret = of_parse_phandle_with_args(of_node, "sound-dai", "#sound-dai-cells",
- index, &args);
- if (ret)
- return ret;
-
- ret = snd_soc_get_dai_name(&args, &component->dai_name);
- if (ret < 0)
- return ret;
-
- component->of_node = args.np;
- return 0;
-}
-
/*
* snd_soc_of_put_dai_link_codecs - Dereference device nodes in the codecs array
* @dai_link: DAI link
@@ -3466,7 +3446,7 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev,
/* Parse the list */
for_each_link_codecs(dai_link, index, component) {
- ret = __snd_soc_of_get_dai_link_component_parse(of_node, component, index);
+ ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
if (ret)
goto err;
}
@@ -3521,7 +3501,7 @@ int snd_soc_of_get_dai_link_cpus(struct device *dev,
/* Parse the list */
for_each_link_cpus(dai_link, index, component) {
- ret = __snd_soc_of_get_dai_link_component_parse(of_node, component, index);
+ ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
if (ret)
goto err;
}