diff options
author | Nariman Poushin <nariman@opensource.wolfsonmicro.com> | 2014-04-01 12:59:33 (GMT) |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-14 16:23:38 (GMT) |
commit | b318ad503698160183fe5e0752b9a1bb3e558026 (patch) | |
tree | c0bb12b4f448e9973f565f84c5ed53c113e9d022 /sound/soc/soc-core.c | |
parent | 261edc7013a7435e40fd5ebb3682eac6fc3c15ea (diff) | |
download | linux-b318ad503698160183fe5e0752b9a1bb3e558026.tar.xz |
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>
Diffstat (limited to 'sound/soc/soc-core.c')
-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 d5710fc..7774531 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) { |