[alsa-devel] [PATCH] ASoC: core: Fail probe if we fail to add dai widgets

Nariman Poushin nariman at opensource.wolfsonmicro.com
Mon Mar 31 16:47:12 CEST 2014


Signed-off-by: Nariman Poushin <nariman at opensource.wolfsonmicro.com>
---
 sound/soc/soc-core.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b322cf2..5cf7107 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1132,8 +1132,15 @@ static int soc_probe_codec(struct snd_soc_card *card,
 					  driver->num_dapm_widgets);
 
 	/* Create DAPM widgets for each DAI stream */
-	list_for_each_entry(dai, &codec->component.dai_list, list)
-		snd_soc_dapm_new_dai_widgets(&codec->dapm, dai);
+	list_for_each_entry(dai, &codec->component.dai_list, list) {
+		ret = snd_soc_dapm_new_dai_widgets(&codec->dapm, dai);
+
+		if (ret != 0) {
+			dev_err(codec->dev,
+				"Failed to create DAI widgets %d\n", ret);
+			goto err_probe;
+		}
+	}
 
 	codec->dapm.idle_bias_off = driver->idle_bias_off;
 
-- 
1.8.5.3



More information about the Alsa-devel mailing list