diff options
author | Ranjani Sridharan <ranjani.sridharan@linux.intel.com> | 2022-04-26 10:17:41 -0700 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-04-29 13:06:03 +0100 |
commit | a5ba725e9dc928832ba97a4418e36fef8d0244c6 (patch) | |
tree | 53eed6988f3bc349855f30e72b55d141525c2af0 /sound/soc/sof/topology.c | |
parent | f18ad9caa0dfeb12cb386777b1130c5fba9a0079 (diff) | |
download | linux-stable-a5ba725e9dc928832ba97a4418e36fef8d0244c6.tar.gz linux-stable-a5ba725e9dc928832ba97a4418e36fef8d0244c6.tar.bz2 linux-stable-a5ba725e9dc928832ba97a4418e36fef8d0244c6.zip |
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: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220426171743.171061-10-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/topology.c')
-rw-r--r-- | sound/soc/sof/topology.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 739f343010fc..b1fcab7ce48e 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -1721,14 +1721,16 @@ static int sof_link_load(struct snd_soc_component *scomp, int index, struct snd_ return -ENOMEM; } - /* parse one set of DAI link tokens */ - ret = sof_copy_tuples(sdev, private->array, le32_to_cpu(private->size), - SOF_DAI_LINK_TOKENS, 1, slink->tuples, - num_tuples, &slink->num_tuples); - if (ret < 0) { - dev_err(scomp->dev, "failed to parse %s for dai link %s\n", - token_list[SOF_DAI_LINK_TOKENS].name, link->name); - goto err; + if (token_list[SOF_DAI_LINK_TOKENS].tokens) { + /* parse one set of DAI link tokens */ + ret = sof_copy_tuples(sdev, private->array, le32_to_cpu(private->size), + SOF_DAI_LINK_TOKENS, 1, slink->tuples, + num_tuples, &slink->num_tuples); + if (ret < 0) { + dev_err(scomp->dev, "failed to parse %s for dai link %s\n", + token_list[SOF_DAI_LINK_TOKENS].name, link->name); + goto err; + } } /* nothing more to do if there are no DAI type-specific tokens defined */ |