diff options
author | Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> | 2019-06-17 13:36:40 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-06-25 16:33:16 +0200 |
commit | e79986ce50d65f490c6eab3aaea1ff2ab5df5d04 (patch) | |
tree | 8eed10ca705635c6427400048e4a09abab3178f4 /sound/soc/intel/skylake/skl-topology.c | |
parent | ASoC: Intel: Skylake: Add function to cleanup debugfs interface (diff) | |
download | linux-e79986ce50d65f490c6eab3aaea1ff2ab5df5d04.tar.xz linux-e79986ce50d65f490c6eab3aaea1ff2ab5df5d04.zip |
ASoC: Intel: Skylake: Properly cleanup on component removal
When we remove component we need to reverse things which were done on
init, this consists of topology cleanup, lists cleanup and releasing
firmware.
Currently cleanup handlers are put in wrong places or otherwise missing.
So add proper component cleanup function and perform cleanups in it.
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/skylake/skl-topology.c')
-rw-r--r-- | sound/soc/intel/skylake/skl-topology.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 9fd756bcc740..99825dda34af 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -3757,3 +3757,18 @@ int skl_tplg_init(struct snd_soc_component *component, struct hdac_bus *bus) return 0; } + +void skl_tplg_exit(struct snd_soc_component *component, struct hdac_bus *bus) +{ + struct skl *skl = bus_to_skl(bus); + struct skl_pipeline *ppl, *tmp; + + if (!list_empty(&skl->ppl_list)) + list_for_each_entry_safe(ppl, tmp, &skl->ppl_list, node) + list_del(&ppl->node); + + /* clean up topology */ + snd_soc_tplg_component_remove(component, SND_SOC_TPLG_INDEX_ALL); + + release_firmware(skl->tplg); +} |