diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-08-20 14:04:58 +0900 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-08-21 13:11:37 +0100 |
commit | c26a8841119826badc8d358a4266880f83359f26 (patch) | |
tree | 0bbe6fadc036da65bc298f12649bb71f603694f9 /sound/soc/soc-core.c | |
parent | b03bfaec1d52123d5d941488f71e06964535e471 (diff) | |
download | lwn-c26a8841119826badc8d358a4266880f83359f26.tar.gz lwn-c26a8841119826badc8d358a4266880f83359f26.zip |
ASoC: soc-core: remove unneeded dai_link check from snd_soc_remove_dai_link()
snd_soc_remove_dai_link() has card connected dai_link check. but
1) we need to call list_del() anyway,
because it is "remove" function,
2) It is doing many thing for this card / dai_link already
before checking dai_link.
This patch removes poinless dai_link check
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/875zms1ldm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d428491d51a7..6df880be1622 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1182,8 +1182,6 @@ EXPORT_SYMBOL_GPL(snd_soc_add_dai_link); void snd_soc_remove_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { - struct snd_soc_dai_link *link, *_link; - if (dai_link->dobj.type && dai_link->dobj.type != SND_SOC_DOBJ_DAI_LINK) { dev_err(card->dev, "Invalid dai link type %d\n", @@ -1199,12 +1197,7 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, if (dai_link->dobj.type && card->remove_dai_link) card->remove_dai_link(card, dai_link); - for_each_card_links_safe(card, link, _link) { - if (link == dai_link) { - list_del(&link->list); - return; - } - } + list_del(&dai_link->list); } EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link); |