Merge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[sfrench/cifs-2.6.git] / sound / soc / soc-topology.c
index c98766957c10817265ec497567bb8e5b23348b70..1f81cd2d29cfa3ff8dbc81c2863aa6d3b4676e18 100644 (file)
@@ -1909,6 +1909,10 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
        link->num_codecs = 1;
        link->num_platforms = 1;
 
+       link->dobj.index = tplg->index;
+       link->dobj.ops = tplg->ops;
+       link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
+
        if (strlen(pcm->pcm_name)) {
                link->name = kstrdup(pcm->pcm_name, GFP_KERNEL);
                link->stream_name = kstrdup(pcm->pcm_name, GFP_KERNEL);
@@ -1945,9 +1949,6 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg,
                goto err;
        }
 
-       link->dobj.index = tplg->index;
-       link->dobj.ops = tplg->ops;
-       link->dobj.type = SND_SOC_DOBJ_DAI_LINK;
        list_add(&link->dobj.list, &tplg->comp->dobj_list);
 
        return 0;
@@ -2777,7 +2778,7 @@ void snd_soc_tplg_widget_remove_all(struct snd_soc_dapm_context *dapm,
 {
        struct snd_soc_dapm_widget *w, *next_w;
 
-       list_for_each_entry_safe(w, next_w, &dapm->card->widgets, list) {
+       for_each_card_widgets_safe(dapm->card, w, next_w) {
 
                /* make sure we are a widget with correct context */
                if (w->dobj.type != SND_SOC_DOBJ_WIDGET || w->dapm != dapm)