Skip to content

Commit 2e1dbea

Browse files
morimotobroonie
authored andcommitted
ASoC: meson: 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/87legedgmy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 6cf881b commit 2e1dbea

4 files changed

Lines changed: 8 additions & 17 deletions

File tree

sound/soc/meson/axg-card.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,7 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
319319
dai_link->cpus = cpu;
320320
dai_link->num_cpus = 1;
321321

322-
ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node,
323-
&dai_link->cpus->dai_name);
322+
ret = meson_card_parse_dai(card, np, dai_link->cpus);
324323
if (ret)
325324
return ret;
326325

sound/soc/meson/gx-card.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np,
9090
dai_link->cpus = cpu;
9191
dai_link->num_cpus = 1;
9292

93-
ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node,
94-
&dai_link->cpus->dai_name);
93+
ret = meson_card_parse_dai(card, np, dai_link->cpus);
9594
if (ret)
9695
return ret;
9796

sound/soc/meson/meson-card-utils.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,18 @@ EXPORT_SYMBOL_GPL(meson_card_reallocate_links);
7474

7575
int meson_card_parse_dai(struct snd_soc_card *card,
7676
struct device_node *node,
77-
struct device_node **dai_of_node,
78-
const char **dai_name)
77+
struct snd_soc_dai_link_component *dlc)
7978
{
80-
struct of_phandle_args args;
8179
int ret;
8280

83-
if (!dai_name || !dai_of_node || !node)
81+
if (!dlc || !node)
8482
return -EINVAL;
8583

86-
ret = of_parse_phandle_with_args(node, "sound-dai",
87-
"#sound-dai-cells", 0, &args);
84+
ret = snd_soc_of_get_dlc(node, NULL, dlc, 0);
8885
if (ret)
8986
return dev_err_probe(card->dev, ret, "can't parse dai\n");
9087

91-
*dai_of_node = args.np;
92-
93-
return snd_soc_get_dai_name(&args, dai_name);
88+
return ret;
9489
}
9590
EXPORT_SYMBOL_GPL(meson_card_parse_dai);
9691

@@ -160,8 +155,7 @@ int meson_card_set_be_link(struct snd_soc_card *card,
160155
link->num_codecs = num_codecs;
161156

162157
for_each_child_of_node(node, np) {
163-
ret = meson_card_parse_dai(card, np, &codec->of_node,
164-
&codec->dai_name);
158+
ret = meson_card_parse_dai(card, np, codec);
165159
if (ret) {
166160
of_node_put(np);
167161
return ret;

sound/soc/meson/meson-card.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ int meson_card_reallocate_links(struct snd_soc_card *card,
3939
unsigned int num_links);
4040
int meson_card_parse_dai(struct snd_soc_card *card,
4141
struct device_node *node,
42-
struct device_node **dai_of_node,
43-
const char **dai_name);
42+
struct snd_soc_dai_link_component *dlc);
4443
int meson_card_set_be_link(struct snd_soc_card *card,
4544
struct snd_soc_dai_link *link,
4645
struct device_node *node);

0 commit comments

Comments
 (0)