summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/arizona.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2015-12-29 12:49:19 +0300
committerMark Brown <broonie@kernel.org>2015-12-30 20:26:08 +0300
commit26eb5a9a6a8545ebb9d45de9e6d43e511b250839 (patch)
treea8599650d1b8f549bda5ab25e8217910a74a0d45 /sound/soc/codecs/arizona.c
parente116615b80bb89484ad4d55c752a00dd6379f95c (diff)
downloadlinux-26eb5a9a6a8545ebb9d45de9e6d43e511b250839.tar.xz
ASoC: arizona: Exit startup early if no runtime
commit 9b8ef9f6b3fc ("ASoC: dapm: Add startup & shutdown for dai_links") Added support for calling startup on CODEC to CODEC links, however this is called with a NULL runtime pointer. There isn't really a sensible way to pass a valid runtime pointer to a CODEC to CODEC link at the moment, so we need to make the startup function safe for NULL runtimes. This patch returns from the Arizona startup function early if there is no runtime, this is perfectly safe as all the startup function does is set the PCM constraints for user-space which arn't relevant to a CODEC to CODEC link anyway. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/arizona.c')
-rw-r--r--sound/soc/codecs/arizona.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index 38a73e3da508..88e2c74f1d17 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -1494,6 +1494,9 @@ static int arizona_startup(struct snd_pcm_substream *substream,
const struct snd_pcm_hw_constraint_list *constraint;
unsigned int base_rate;
+ if (!substream->runtime)
+ return 0;
+
switch (dai_priv->clk) {
case ARIZONA_CLK_SYSCLK:
base_rate = priv->sysclk;