[alsa-devel] [PATCH 10/28] ASoC: soc-core: don't check controls for snd_soc_add_card_controls()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Tue Aug 6 03:29:02 CEST 2019


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

snd_soc_add_card_controls() registers controls by using
for(... i < num; ...). If controls was NULL, num should be zero.
Thus, we don't need to check about controls pointer.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 sound/soc/soc-core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 5b26a59..f138c83 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2048,9 +2048,8 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
 	snd_soc_dapm_link_dai_widgets(card);
 	snd_soc_dapm_connect_dai_link_widgets(card);
 
-	if (card->controls)
-		snd_soc_add_card_controls(card, card->controls,
-					  card->num_controls);
+	snd_soc_add_card_controls(card, card->controls,
+				  card->num_controls);
 
 	snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
 				card->num_dapm_routes);
-- 
2.7.4



More information about the Alsa-devel mailing list