Skip to content

Commit 14c9b25

Browse files
morimotobroonie
authored andcommitted
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>
1 parent db588ea commit 14c9b25

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

sound/soc/soc-core.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3402,26 +3402,6 @@ static int __snd_soc_of_get_dai_link_component_alloc(
34023402
return 0;
34033403
}
34043404

3405-
static int __snd_soc_of_get_dai_link_component_parse(
3406-
struct device_node *of_node,
3407-
struct snd_soc_dai_link_component *component, int index)
3408-
{
3409-
struct of_phandle_args args;
3410-
int ret;
3411-
3412-
ret = of_parse_phandle_with_args(of_node, "sound-dai", "#sound-dai-cells",
3413-
index, &args);
3414-
if (ret)
3415-
return ret;
3416-
3417-
ret = snd_soc_get_dai_name(&args, &component->dai_name);
3418-
if (ret < 0)
3419-
return ret;
3420-
3421-
component->of_node = args.np;
3422-
return 0;
3423-
}
3424-
34253405
/*
34263406
* snd_soc_of_put_dai_link_codecs - Dereference device nodes in the codecs array
34273407
* @dai_link: DAI link
@@ -3466,7 +3446,7 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev,
34663446

34673447
/* Parse the list */
34683448
for_each_link_codecs(dai_link, index, component) {
3469-
ret = __snd_soc_of_get_dai_link_component_parse(of_node, component, index);
3449+
ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
34703450
if (ret)
34713451
goto err;
34723452
}
@@ -3521,7 +3501,7 @@ int snd_soc_of_get_dai_link_cpus(struct device *dev,
35213501

35223502
/* Parse the list */
35233503
for_each_link_cpus(dai_link, index, component) {
3524-
ret = __snd_soc_of_get_dai_link_component_parse(of_node, component, index);
3504+
ret = snd_soc_of_get_dlc(of_node, NULL, component, index);
35253505
if (ret)
35263506
goto err;
35273507
}

0 commit comments

Comments
 (0)