diff options
author | Amadeusz Sławiński <[email protected]> | 2024-06-27 12:18:38 +0200 |
---|---|---|
committer | Mark Brown <[email protected]> | 2024-07-02 14:26:57 +0100 |
commit | 97a05cb4ab12f55e19cf28f6ceca47bb6ed8fea4 (patch) | |
tree | ef659d96f26fdeb45af2018ddcadb23b263596dd | |
parent | a893a804c6bb09336a217780c722b7d1c88357c6 (diff) |
ASoC: topology: Simplify code
Instead of using goto, when there is no controls, just do a loop when
there are. Overall the check seems to be a bit redundant as
num_kcontrols will only be above 0 if kcontrols are set anyway, but
let's keep it, while simplifying code.
Signed-off-by: Amadeusz Sławiński <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
-rw-r--r-- | sound/soc/soc-topology.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 4b166294602f..dff83d49a8f6 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -394,13 +394,9 @@ static void soc_tplg_remove_widget(struct snd_soc_component *comp, if (dobj->unload) dobj->unload(comp, dobj); - if (!w->kcontrols) - goto free_news; - - for (i = 0; w->kcontrols && i < w->num_kcontrols; i++) - snd_ctl_remove(card, w->kcontrols[i]); - -free_news: + if (w->kcontrols) + for (i = 0; i < w->num_kcontrols; i++) + snd_ctl_remove(card, w->kcontrols[i]); list_del(&dobj->list); |