Skip to content

Commit 50233f2

Browse files
morimotobroonie
authored andcommitted
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87jzvydgms.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2e1dbea commit 50233f2

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

sound/soc/samsung/odroid.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ static int odroid_audio_probe(struct platform_device *pdev)
205205
struct snd_soc_card *card;
206206
struct snd_soc_dai_link *link, *codec_link;
207207
int num_pcms, ret, i;
208-
struct of_phandle_args args = {};
209208

210209
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
211210
if (!priv)
@@ -260,20 +259,7 @@ static int odroid_audio_probe(struct platform_device *pdev)
260259
}
261260

262261
for (i = 0; i < num_pcms; i++, link += 2) {
263-
ret = of_parse_phandle_with_args(cpu, "sound-dai",
264-
"#sound-dai-cells", i, &args);
265-
if (ret < 0)
266-
break;
267-
268-
if (!args.np) {
269-
dev_err(dev, "sound-dai property parse error: %d\n", ret);
270-
ret = -EINVAL;
271-
break;
272-
}
273-
274-
ret = snd_soc_get_dai_name(&args, &link->cpus->dai_name);
275-
of_node_put(args.np);
276-
262+
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name, i);
277263
if (ret < 0)
278264
break;
279265
}

0 commit comments

Comments
 (0)