ASoC: topology: Reduce number of dereferences when accessing dobj
authorAmadeusz Sławiński <amadeuszx.slawinski@intel.com>
Fri, 25 Jan 2019 20:06:42 +0000 (14:06 -0600)
committerMark Brown <broonie@kernel.org>
Tue, 29 Jan 2019 18:01:15 +0000 (18:01 +0000)
We already have passed dobj, there is no reason to access it through
containing structs.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c

index 045ef136903d63b4a7e3339e137cb5156dedffb7..b02c41614f96e382fb9e0a569ecd4b41c940465b 100644 (file)
@@ -382,10 +382,10 @@ static void remove_mixer(struct snd_soc_component *comp,
        if (dobj->ops && dobj->ops->control_unload)
                dobj->ops->control_unload(comp, dobj);
 
-       if (sm->dobj.control.kcontrol->tlv.p)
-               p = sm->dobj.control.kcontrol->tlv.p;
-       snd_ctl_remove(card, sm->dobj.control.kcontrol);
-       list_del(&sm->dobj.list);
+       if (dobj->control.kcontrol->tlv.p)
+               p = dobj->control.kcontrol->tlv.p;
+       snd_ctl_remove(card, dobj->control.kcontrol);
+       list_del(&dobj->list);
        kfree(sm);
        kfree(p);
 }
@@ -404,12 +404,12 @@ static void remove_enum(struct snd_soc_component *comp,
        if (dobj->ops && dobj->ops->control_unload)
                dobj->ops->control_unload(comp, dobj);
 
-       snd_ctl_remove(card, se->dobj.control.kcontrol);
-       list_del(&se->dobj.list);
+       snd_ctl_remove(card, dobj->control.kcontrol);
+       list_del(&dobj->list);
 
-       kfree(se->dobj.control.dvalues);
+       kfree(dobj->control.dvalues);
        for (i = 0; i < se->items; i++)
-               kfree(se->dobj.control.dtexts[i]);
+               kfree(dobj->control.dtexts[i]);
        kfree(se);
 }
 
@@ -427,8 +427,8 @@ static void remove_bytes(struct snd_soc_component *comp,
        if (dobj->ops && dobj->ops->control_unload)
                dobj->ops->control_unload(comp, dobj);
 
-       snd_ctl_remove(card, sb->dobj.control.kcontrol);
-       list_del(&sb->dobj.list);
+       snd_ctl_remove(card, dobj->control.kcontrol);
+       list_del(&dobj->list);
        kfree(sb);
 }
 
@@ -464,9 +464,9 @@ static void remove_widget(struct snd_soc_component *comp,
 
                        snd_ctl_remove(card, kcontrol);
 
-                       kfree(se->dobj.control.dvalues);
+                       kfree(dobj->control.dvalues);
                        for (j = 0; j < se->items; j++)
-                               kfree(se->dobj.control.dtexts[j]);
+                               kfree(dobj->control.dtexts[j]);
 
                        kfree(se);
                        kfree(w->kcontrol_news[i].name);