Re: [PATCH v2 4/4] ASoC: soc-topology.c: remove unnecessary dai_link->platform

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Morimoto-san,

On 24/03/2023 00:53, Kuninori Morimoto wrote:
> dai_link->platform is no longer needed if CPU and Platform are
> same Component. This patch removes unnecessary dai_link->platform.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
> ---
>  sound/soc/soc-topology.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
> index 07421f5d4ebd..7f6424fa59ab 100644
> --- a/sound/soc/soc-topology.c
> +++ b/sound/soc/soc-topology.c
> @@ -1685,8 +1685,8 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
>  	struct snd_soc_dai_link_component *dlc;
>  	int ret;
>  
> -	/* link + cpu + codec + platform */
> -	link = devm_kzalloc(tplg->dev, sizeof(*link) + (3 * sizeof(*dlc)), GFP_KERNEL);
> +	/* link + cpu + codec */
> +	link = devm_kzalloc(tplg->dev, sizeof(*link) + (2 * sizeof(*dlc)), GFP_KERNEL);
>  	if (link == NULL)
>  		return -ENOMEM;
>  
> @@ -1694,11 +1694,9 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
>  
>  	link->cpus	= &dlc[0];
>  	link->codecs	= &dlc[1];
> -	link->platforms	= &dlc[2];
>  
>  	link->num_cpus	 = 1;
>  	link->num_codecs = 1;
> -	link->num_platforms = 1;
>  
>  	link->dobj.index = tplg->index;
>  	link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
> @@ -1726,8 +1724,6 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
>  	link->codecs->name = "snd-soc-dummy";
>  	link->codecs->dai_name = "snd-soc-dummy-dai";
>  
> -	link->platforms->name = "snd-soc-dummy";
> -

I think this patch is incorrect and should be reverted (I have received
a note from a SOF developer).
The link->cpus->dai_name is not necessarily "snd-soc-dummy", it is set
earlier:
if (strlen(pcm->dai_name)) {
	link->cpus->dai_name = devm_kstrdup(tplg->dev, pcm->dai_name,
					    GFP_KERNEL);
	if (!link->cpus->dai_name) {
		ret = -ENOMEM;
		goto err;
	}
}

We cannot be sure that it is the same component, in fact it is most like
not.

>  	/* enable DPCM */
>  	link->dynamic = 1;
>  	link->ignore_pmdown_time = 1;

-- 
Péter



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux