Commit 50233f28 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: samsung: 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.

- note: need deep check
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87jzvydgms.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2e1dbea1
...@@ -205,7 +205,6 @@ static int odroid_audio_probe(struct platform_device *pdev) ...@@ -205,7 +205,6 @@ static int odroid_audio_probe(struct platform_device *pdev)
struct snd_soc_card *card; struct snd_soc_card *card;
struct snd_soc_dai_link *link, *codec_link; struct snd_soc_dai_link *link, *codec_link;
int num_pcms, ret, i; int num_pcms, ret, i;
struct of_phandle_args args = {};
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -260,20 +259,7 @@ static int odroid_audio_probe(struct platform_device *pdev) ...@@ -260,20 +259,7 @@ static int odroid_audio_probe(struct platform_device *pdev)
} }
for (i = 0; i < num_pcms; i++, link += 2) { for (i = 0; i < num_pcms; i++, link += 2) {
ret = of_parse_phandle_with_args(cpu, "sound-dai", ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name, i);
"#sound-dai-cells", i, &args);
if (ret < 0)
break;
if (!args.np) {
dev_err(dev, "sound-dai property parse error: %d\n", ret);
ret = -EINVAL;
break;
}
ret = snd_soc_get_dai_name(&args, &link->cpus->dai_name);
of_node_put(args.np);
if (ret < 0) if (ret < 0)
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment