diff options
author | Ricard Wanderlof <ricard.wanderlof@axis.com> | 2019-07-24 11:38:44 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-07-24 17:01:45 +0100 |
commit | 40aa5383e393d72f6aa3943a4e7b1aae25a1e43b (patch) | |
tree | 06fe033ee22483e3b39c84acb848c688bad562d4 /sound/soc/soc-core.c | |
parent | 717dedb1dcee92788b81233aa0a221573c95daff (diff) | |
download | lwn-40aa5383e393d72f6aa3943a4e7b1aae25a1e43b.tar.gz lwn-40aa5383e393d72f6aa3943a4e7b1aae25a1e43b.zip |
ASoC: Fail card instantiation if DAI format setup fails
If the DAI format setup fails, there is no valid communication format
between CPU and CODEC, so fail card instantiation, rather than continue
with a card that will most likely not function properly.
Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
Link: https://lore.kernel.org/r/alpine.DEB.2.20.1907241132350.6338@lnxricardw1.se.axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index c0a774d0a5ff..1486fb2eb921 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1511,8 +1511,11 @@ static int soc_probe_link_dais(struct snd_soc_card *card, } } - if (dai_link->dai_fmt) - snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); + if (dai_link->dai_fmt) { + ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); + if (ret) + return ret; + } ret = soc_post_component_init(rtd, dai_link->name); if (ret) |