|
@@ -1734,7 +1734,6 @@ void snd_soc_tplg_widget_remove_all(struct snd_soc_dapm_context *dapm,
|
|
u32 index)
|
|
u32 index)
|
|
{
|
|
{
|
|
struct snd_soc_dapm_widget *w, *next_w;
|
|
struct snd_soc_dapm_widget *w, *next_w;
|
|
- struct snd_soc_dapm_path *p, *next_p;
|
|
|
|
|
|
|
|
list_for_each_entry_safe(w, next_w, &dapm->card->widgets, list) {
|
|
list_for_each_entry_safe(w, next_w, &dapm->card->widgets, list) {
|
|
|
|
|
|
@@ -1746,31 +1745,9 @@ void snd_soc_tplg_widget_remove_all(struct snd_soc_dapm_context *dapm,
|
|
if (w->dobj.index != index &&
|
|
if (w->dobj.index != index &&
|
|
w->dobj.index != SND_SOC_TPLG_INDEX_ALL)
|
|
w->dobj.index != SND_SOC_TPLG_INDEX_ALL)
|
|
continue;
|
|
continue;
|
|
-
|
|
|
|
- list_del(&w->list);
|
|
|
|
-
|
|
|
|
- /*
|
|
|
|
- * remove source and sink paths associated to this widget.
|
|
|
|
- * While removing the path, remove reference to it from both
|
|
|
|
- * source and sink widgets so that path is removed only once.
|
|
|
|
- */
|
|
|
|
- list_for_each_entry_safe(p, next_p, &w->sources, list_sink) {
|
|
|
|
- list_del(&p->list_sink);
|
|
|
|
- list_del(&p->list_source);
|
|
|
|
- list_del(&p->list);
|
|
|
|
- kfree(p);
|
|
|
|
- }
|
|
|
|
- list_for_each_entry_safe(p, next_p, &w->sinks, list_source) {
|
|
|
|
- list_del(&p->list_sink);
|
|
|
|
- list_del(&p->list_source);
|
|
|
|
- list_del(&p->list);
|
|
|
|
- kfree(p);
|
|
|
|
- }
|
|
|
|
/* check and free and dynamic widget kcontrols */
|
|
/* check and free and dynamic widget kcontrols */
|
|
snd_soc_tplg_widget_remove(w);
|
|
snd_soc_tplg_widget_remove(w);
|
|
- kfree(w->kcontrols);
|
|
|
|
- kfree(w->name);
|
|
|
|
- kfree(w);
|
|
|
|
|
|
+ snd_soc_dapm_free_widget(w);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(snd_soc_tplg_widget_remove_all);
|
|
EXPORT_SYMBOL_GPL(snd_soc_tplg_widget_remove_all);
|