Commit b318ad50 authored by Nariman Poushin's avatar Nariman Poushin Committed by Mark Brown

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

Signed-off-by: default avatarNariman Poushin <nariman@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 261edc70
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment