diff options
author | Nariman Poushin <nariman@opensource.wolfsonmicro.com> | 2014-04-01 14:59:33 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-14 18:23:38 +0200 |
commit | b318ad503698160183fe5e0752b9a1bb3e558026 (patch) | |
tree | c0bb12b4f448e9973f565f84c5ed53c113e9d022 | |
parent | ASoC: core: Fail probe if we fail to add dai widgets (diff) | |
download | linux-b318ad503698160183fe5e0752b9a1bb3e558026.tar.xz linux-b318ad503698160183fe5e0752b9a1bb3e558026.zip |
ASoC: core: Fail codec probe if we fail to add controls
Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/soc-core.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d5710fc79b49..777453158347 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -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) { |