]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: mediatek: cleanup mtk_sof_dailink_parse_of() param
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 8 Jun 2026 01:24:43 +0000 (01:24 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 12 Jun 2026 15:06:59 +0000 (16:06 +0100)
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>
sound/soc/mediatek/common/mtk-dsp-sof-common.c
sound/soc/mediatek/common/mtk-dsp-sof-common.h
sound/soc/mediatek/common/mtk-soundcard-driver.c

index fd10616a08a065786caa12953ab105b47461b061..17b9ea6be6040fb98f3526d00c0666458678f755 100644 (file)
@@ -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;
                        }
index 8784ee471132a95ebe6d00e063c3b8a451f675ce..1a0a47d64761f95accb40fad5395f219d7b4ae4f 100644 (file)
@@ -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
index cdff7322426a903dc00857cdeba5156af14d0e4a..24118217fe5c21c3dd5c928cd1036df3539c5412 100644 (file)
@@ -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);