From: Kuninori Morimoto Date: Mon, 8 Jun 2026 01:24:43 +0000 (+0000) Subject: ASoC: mediatek: cleanup mtk_sof_dailink_parse_of() param X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7d3dc1dd345b505d2f02175464ff0b12e5ea37e;p=thirdparty%2Flinux.git 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 Link: https://patch.msgid.link/87h5ndesdg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.c b/sound/soc/mediatek/common/mtk-dsp-sof-common.c index fd10616a08a0..17b9ea6be604 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 8784ee471132..1a0a47d64761 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 cdff7322426a..24118217fe5c 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);