mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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>
This commit is contained in:
parent
38b75d81a0
commit
d7d3dc1dd3
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user