From: Ricard Wanderlof Date: Wed, 24 Jul 2019 09:38:44 +0000 (+0200) Subject: ASoC: Fail card instantiation if DAI format setup fails X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a56c79efe4dc8ae560eb2c9a4b755d57c8c2e8f4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ASoC: Fail card instantiation if DAI format setup fails [ Upstream commit 40aa5383e393d72f6aa3943a4e7b1aae25a1e43b ] 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 Link: https://lore.kernel.org/r/alpine.DEB.2.20.1907241132350.6338@lnxricardw1.se.axis.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 42c2a3065b77..ff5206f5455d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1757,8 +1757,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)