Skip to content

Commit aa560f5

Browse files
morimotobroonie
authored andcommitted
ASoC: fsl: 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/87o7ladgn9.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3c8b586 commit aa560f5

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

sound/soc/fsl/imx-card.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,10 @@ static int imx_card_parse_of(struct imx_card_data *data)
551551
goto err;
552552
}
553553

554-
ret = of_parse_phandle_with_args(cpu, "sound-dai",
555-
"#sound-dai-cells", 0, &args);
554+
ret = snd_soc_of_get_dlc(cpu, &args, link->cpus, 0);
556555
if (ret) {
557-
dev_err(card->dev, "%s: error getting cpu phandle\n", link->name);
556+
dev_err_probe(card->dev, ret,
557+
"%s: error getting cpu dai info\n", link->name);
558558
goto err;
559559
}
560560

@@ -582,17 +582,9 @@ static int imx_card_parse_of(struct imx_card_data *data)
582582
}
583583
}
584584

585-
link->cpus->of_node = args.np;
586585
link->platforms->of_node = link->cpus->of_node;
587586
link->id = args.args[0];
588587

589-
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name, 0);
590-
if (ret) {
591-
dev_err_probe(card->dev, ret,
592-
"%s: error getting cpu dai name\n", link->name);
593-
goto err;
594-
}
595-
596588
codec = of_get_child_by_name(np, "codec");
597589
if (codec) {
598590
ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);

sound/soc/fsl/imx-rpmsg.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
9696
} else {
9797
struct clk *clk;
9898

99-
data->dai.codecs->of_node = args.np;
100-
ret = snd_soc_get_dai_name(&args, &data->dai.codecs->dai_name);
99+
ret = snd_soc_get_dlc(&args, data->dai.codecs);
101100
if (ret) {
102101
dev_err(&pdev->dev, "Unable to get codec_dai_name\n");
103102
goto fail;

0 commit comments

Comments
 (0)