[10/28] ASoC: soc-core: don't check controls for snd_soc_add_card_controls()
diff mbox series

Message ID 87mugn2igu.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series
  • ASoC: cleanup patches for soc-core
Related show

Commit Message

Kuninori Morimoto Aug. 6, 2019, 1:29 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@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@renesas.com>
---
 sound/soc/soc-core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch
diff mbox series

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);