Commit a5ba725e authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Mark Brown

ASoC: SOF: topology: Skip parsing DAI link tokens if not needed

Do not parse these tokens if they are not defined in the IPC version
specific token list. In the case of IPC4 with HDA topologies for
example, no DAI link specific tokens need to be added in topology.
Signed-off-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220426171743.171061-10-ranjani.sridharan@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f18ad9ca
...@@ -1721,14 +1721,16 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, struct snd_ ...@@ -1721,14 +1721,16 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, struct snd_
return -ENOMEM; return -ENOMEM;
} }
/* parse one set of DAI link tokens */ if (token_list[SOF_DAI_LINK_TOKENS].tokens) {
ret = sof_copy_tuples(sdev, private->array, le32_to_cpu(private->size), /* parse one set of DAI link tokens */
SOF_DAI_LINK_TOKENS, 1, slink->tuples, ret = sof_copy_tuples(sdev, private->array, le32_to_cpu(private->size),
num_tuples, &slink->num_tuples); SOF_DAI_LINK_TOKENS, 1, slink->tuples,
if (ret < 0) { num_tuples, &slink->num_tuples);
dev_err(scomp->dev, "failed to parse %s for dai link %s\n", if (ret < 0) {
token_list[SOF_DAI_LINK_TOKENS].name, link->name); dev_err(scomp->dev, "failed to parse %s for dai link %s\n",
goto err; token_list[SOF_DAI_LINK_TOKENS].name, link->name);
goto err;
}
} }
/* nothing more to do if there are no DAI type-specific tokens defined */ /* nothing more to do if there are no DAI type-specific tokens defined */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment