Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: soc-topology.c: dai_link->platform again

On SOF, many topology is assuming dai_link->platform exists, and is
allowed to be overwritten on each link_load().
This patch restore the removed dai_link->platform for SOF, and add
the comment.

Fixes: e7098ba9b378 ("ASoC: soc-topology.c: remove unnecessary dai_link->platform")
Reported-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/87jzz7jczp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/87v8ikcsr5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
6a7c51b4 d6790ae0

+10 -2
+10 -2
sound/soc/soc-topology.c
··· 1685 1685 struct snd_soc_dai_link_component *dlc; 1686 1686 int ret; 1687 1687 1688 - /* link + cpu + codec */ 1689 - link = devm_kzalloc(tplg->dev, sizeof(*link) + (2 * sizeof(*dlc)), GFP_KERNEL); 1688 + /* link + cpu + codec + platform */ 1689 + link = devm_kzalloc(tplg->dev, sizeof(*link) + (3 * sizeof(*dlc)), GFP_KERNEL); 1690 1690 if (link == NULL) 1691 1691 return -ENOMEM; 1692 1692 ··· 1723 1723 1724 1724 link->codecs->name = "snd-soc-dummy"; 1725 1725 link->codecs->dai_name = "snd-soc-dummy-dai"; 1726 + 1727 + /* 1728 + * Many topology is assuming link has Platform. 1729 + * This might be overwritten at soc_tplg_dai_link_load(). 1730 + */ 1731 + link->platforms = &dlc[2]; 1732 + link->platforms->name = "snd-soc-dummy"; 1733 + link->num_platforms = 1; 1726 1734 1727 1735 /* enable DPCM */ 1728 1736 link->dynamic = 1;