aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2026-06-08 01:24:43 +0000
committerMark Brown <broonie@kernel.org>2026-06-12 16:06:59 +0100
commitd7d3dc1dd345b505d2f02175464ff0b12e5ea37e (patch)
tree16c01b6051d00bb9e67d3daeedc60d06b9afdfec /sound
parent38b75d81a066789dc98404c1387731074c103119 (diff)
downloadath-d7d3dc1dd345b505d2f02175464ff0b12e5ea37e.tar.gz
ASoC: mediatek: cleanup mtk_sof_dailink_parse_of() param
mtk_sof_dailink_parse_of() is using unnecessarily complicated parameters. Let's cleanup it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87h5ndesdg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/mediatek/common/mtk-dsp-sof-common.c13
-rw-r--r--sound/soc/mediatek/common/mtk-dsp-sof-common.h5
-rw-r--r--sound/soc/mediatek/common/mtk-soundcard-driver.c5
3 files changed, 10 insertions, 13 deletions
diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.c b/sound/soc/mediatek/common/mtk-dsp-sof-common.c
index fd10616a08a06..17b9ea6be6040 100644
--- a/sound/soc/mediatek/common/mtk-dsp-sof-common.c
+++ b/sound/soc/mediatek/common/mtk-dsp-sof-common.c
@@ -228,11 +228,10 @@ int mtk_sof_card_late_probe(struct snd_soc_card *card)
}
EXPORT_SYMBOL_GPL(mtk_sof_card_late_probe);
-int mtk_sof_dailink_parse_of(struct snd_soc_card *card, struct device_node *np,
- const char *propname, struct snd_soc_dai_link *pre_dai_links,
- int pre_num_links)
+int mtk_sof_dailink_parse_of(struct device *dev, struct snd_soc_card *card,
+ const char *propname)
{
- struct device *dev = card->dev;
+ struct device_node *np = dev->of_node;
struct snd_soc_dai_link *parsed_dai_link;
const char *dai_name = NULL;
int i, j, ret, num_links, parsed_num_links = 0;
@@ -255,9 +254,9 @@ int mtk_sof_dailink_parse_of(struct snd_soc_card *card, struct device_node *np,
return ret;
}
dev_dbg(dev, "ASoC: Property get dai_name:%s\n", dai_name);
- for (j = 0; j < pre_num_links; j++) {
- if (!strcmp(dai_name, pre_dai_links[j].name)) {
- memcpy(&parsed_dai_link[parsed_num_links++], &pre_dai_links[j],
+ for (j = 0; j < card->num_links; j++) {
+ if (!strcmp(dai_name, card->dai_link[j].name)) {
+ memcpy(&parsed_dai_link[parsed_num_links++], &card->dai_link[j],
sizeof(struct snd_soc_dai_link));
break;
}
diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.h b/sound/soc/mediatek/common/mtk-dsp-sof-common.h
index 8784ee471132a..1a0a47d64761f 100644
--- a/sound/soc/mediatek/common/mtk-dsp-sof-common.h
+++ b/sound/soc/mediatek/common/mtk-dsp-sof-common.h
@@ -36,8 +36,7 @@ int mtk_sof_dai_link_fixup(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params);
int mtk_sof_card_probe(struct snd_soc_card *card);
int mtk_sof_card_late_probe(struct snd_soc_card *card);
-int mtk_sof_dailink_parse_of(struct snd_soc_card *card, struct device_node *np,
- const char *propname, struct snd_soc_dai_link *pre_dai_links,
- int pre_num_links);
+int mtk_sof_dailink_parse_of(struct device *dev, struct snd_soc_card *card,
+ const char *propname);
#endif
diff --git a/sound/soc/mediatek/common/mtk-soundcard-driver.c b/sound/soc/mediatek/common/mtk-soundcard-driver.c
index cdff7322426a9..24118217fe5c2 100644
--- a/sound/soc/mediatek/common/mtk-soundcard-driver.c
+++ b/sound/soc/mediatek/common/mtk-soundcard-driver.c
@@ -275,9 +275,8 @@ int mtk_soundcard_common_probe(struct platform_device *pdev)
if (adsp_node) {
if (of_property_present(pdev->dev.of_node, "mediatek,dai-link")) {
- ret = mtk_sof_dailink_parse_of(card, pdev->dev.of_node,
- "mediatek,dai-link",
- card->dai_link, card->num_links);
+ ret = mtk_sof_dailink_parse_of(&pdev->dev, card,
+ "mediatek,dai-link");
if (ret) {
of_node_put(adsp_node);
of_node_put(platform_node);