提交 b318ad50 编写于 作者: N Nariman Poushin 提交者: Mark Brown

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

Signed-off-by: NNariman Poushin <nariman@opensource.wolfsonmicro.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 261edc70
......@@ -1127,10 +1127,18 @@ 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,
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) {
ret = snd_soc_dapm_new_dai_widgets(&codec->dapm, dai);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册