summaryrefslogtreecommitdiff
path: root/sound/soc/soc-topology.c
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>2020-10-30 10:54:23 -0400
committerMark Brown <broonie@kernel.org>2020-11-04 17:51:05 +0000
commita5b8f71c5477f4327c66a085d9714fe298510819 (patch)
tree7aee0f515a07f57bd50dac2686ece2e082962e98 /sound/soc/soc-topology.c
parent841fb1096713bdd85cb2484557623136e10041d2 (diff)
ASoC: topology: Remove multistep topology loading
In theory topology can be loaded in multiple steps by providing index to snd_soc_tplg_component_load, however, from usability point of view it doesn't make sense, as can be seen from all current users loading topology in one go. Remove the unnecessary parameter. Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20201030145427.3497990-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-topology.c')
-rw-r--r--sound/soc/soc-topology.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 7919097c162f..2a71cec7277e 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -64,7 +64,6 @@ struct soc_tplg {
struct device *dev;
struct snd_soc_component *comp;
u32 index; /* current block index */
- u32 req_index; /* required index, only loaded/free matching blocks */
/* vendor specific kcontrol operations */
const struct snd_soc_tplg_kcontrol_ops *io_ops;
@@ -2680,11 +2679,6 @@ static int soc_tplg_load_header(struct soc_tplg *tplg,
tplg->pos = tplg->hdr_pos + sizeof(struct snd_soc_tplg_hdr);
- /* check for matching ID */
- if (le32_to_cpu(hdr->index) != tplg->req_index &&
- tplg->req_index != SND_SOC_TPLG_INDEX_ALL)
- return 0;
-
tplg->index = le32_to_cpu(hdr->index);
switch (le32_to_cpu(hdr->type)) {
@@ -2804,7 +2798,7 @@ static int soc_tplg_load(struct soc_tplg *tplg)
/* load audio component topology from "firmware" file */
int snd_soc_tplg_component_load(struct snd_soc_component *comp,
- struct snd_soc_tplg_ops *ops, const struct firmware *fw, u32 id)
+ struct snd_soc_tplg_ops *ops, const struct firmware *fw)
{
struct soc_tplg tplg;
int ret;
@@ -2819,7 +2813,6 @@ int snd_soc_tplg_component_load(struct snd_soc_component *comp,
tplg.dev = comp->dev;
tplg.comp = comp;
tplg.ops = ops;
- tplg.req_index = id;
tplg.io_ops = ops->io_ops;
tplg.io_ops_count = ops->io_ops_count;
tplg.bytes_ext_ops = ops->bytes_ext_ops;
@@ -2828,14 +2821,14 @@ int snd_soc_tplg_component_load(struct snd_soc_component *comp,
ret = soc_tplg_load(&tplg);
/* free the created components if fail to load topology */
if (ret)
- snd_soc_tplg_component_remove(comp, SND_SOC_TPLG_INDEX_ALL);
+ snd_soc_tplg_component_remove(comp);
return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_tplg_component_load);
/* remove dynamic controls from the component driver */
-int snd_soc_tplg_component_remove(struct snd_soc_component *comp, u32 index)
+int snd_soc_tplg_component_remove(struct snd_soc_component *comp)
{
struct snd_soc_dobj *dobj, *next_dobj;
int pass = SOC_TPLG_PASS_END;
@@ -2847,11 +2840,6 @@ int snd_soc_tplg_component_remove(struct snd_soc_component *comp, u32 index)
list_for_each_entry_safe(dobj, next_dobj, &comp->dobj_list,
list) {
- /* match index */
- if (dobj->index != index &&
- index != SND_SOC_TPLG_INDEX_ALL)
- continue;
-
switch (dobj->type) {
case SND_SOC_DOBJ_MIXER:
remove_mixer(comp, dobj, pass);