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:27 -0400
committerMark Brown <broonie@kernel.org>2020-11-04 17:51:09 +0000
commit8d456654839cd4fd10225ffa9c70c64784615f95 (patch)
tree5870ff08d74a939ea5937c7d38995a7002c94f37 /sound/soc/soc-topology.c
parent033df362ea3635179d1defed2230be69ed632c05 (diff)
ASoC: topology: Simplify remove_widget function
Now that enum and mixer kcontrols are freed by resource management framework, removing kcontrol becomes one function call, so simplify code in remove_widget. 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-7-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.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 4f632aeeeb5e..07c60187e9ea 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -431,26 +431,8 @@ static void remove_widget(struct snd_soc_component *comp,
if (!w->kcontrols)
goto free_news;
- /*
- * Dynamic Widgets either have 1..N enum kcontrols or mixers.
- * The enum may either have an array of values or strings.
- */
- if (dobj->widget.kcontrol_type == SND_SOC_TPLG_TYPE_ENUM) {
- /* enumerated widget mixer */
- for (i = 0; w->kcontrols != NULL && i < w->num_kcontrols; i++) {
- struct snd_kcontrol *kcontrol = w->kcontrols[i];
-
- snd_ctl_remove(card, kcontrol);
-
- }
- } else {
- /* volume mixer or bytes controls */
- for (i = 0; w->kcontrols != NULL && i < w->num_kcontrols; i++) {
- struct snd_kcontrol *kcontrol = w->kcontrols[i];
-
- snd_ctl_remove(card, kcontrol);
- }
- }
+ for (i = 0; w->kcontrols && i < w->num_kcontrols; i++)
+ snd_ctl_remove(card, w->kcontrols[i]);
free_news: