Skip to contentSkip to conversation

ASoC: core: Fail codec probe if we fail to add controls

PATCH Applied Nariman Poushin 2 participants 3 messages Apr 1, 2014 – Apr 2, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: core: Fail codec probe if we fail to add controls

---
 sound/soc/soc-core.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
sound/soc/soc-core.c +11 -3
index 35c0e71..7f9ae6c 100644
@@ -1127,9 +1127,17 @@ static int soc_probe_codec(struct snd_soc_card *card,
 
 	soc_init_codec_debugfs(codec);
 
-	if (driver->dapm_widgets)
-		snd_soc_dapm_new_controls(&codec->dapm, driver->dapm_widgets,
-					  driver->num_dapm_widgets);
+	if (driver->dapm_widgets) {
+		ret = snd_soc_dapm_new_controls(&codec->dapm,
+						driver->dapm_widgets,
+					  	driver->num_dapm_widgets);
+		
+		if (ret != 0) {
+			dev_err(codec->dev,
+				"Failed to create new controls %d\n", ret);
+			goto err_probe;
+		}
+	}
 
 	/* Create DAPM widgets for each DAI stream */
 	list_for_each_entry(dai, &codec->component.dai_list, list) {
Signature · 1 line
1.8.5.3
maintainer Applied
#1 lore raw
Quoted 1 line · Nariman Poushin

Applied, but:

Applying: ASoC: core: Fail codec probe if we fail to add controls /home/broonie/git/linux/.git/rebase-apply/patch:19: space before tab in indent.

					  	driver->num_dapm_widgets);

/home/broonie/git/linux/.git/rebase-apply/patch:20: trailing whitespace.

please run checkpatch.

#2 lore raw
Quoted 5 lines · Mark Brown
Quoted 1 line · Nariman Poushin

Applied, but:

Quoted 7 lines

Applying: ASoC: core: Fail codec probe if we fail to add controls /home/broonie/git/linux/.git/rebase-apply/patch:19: space before tab in indent.

					  	driver->num_dapm_widgets);

/home/broonie/git/linux/.git/rebase-apply/patch:20: trailing whitespace.

please run checkpatch.

Will make sure to do in future, sorry for to the oversight.