From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: broonie@kernel.org
Cc: vinod.koul@intel.com, jeeja.kp@intel.com,
alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
lgirdwood@gmail.com
Subject: [PATCH] ASoC: arizona: Exit startup early if no runtime
Date: Wed, 23 Dec 2015 12:48:01 +0000 [thread overview]
Message-ID: <1450874881-31458-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
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.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
I will fixup the other users as well if everyone is happy
with this approach?
Thanks,
Charles
sound/soc/codecs/arizona.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index 38a73e3..88e2c74 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;
--
2.1.4
next reply other threads:[~2015-12-23 12:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 12:48 Charles Keepax [this message]
2015-12-24 19:41 ` [PATCH] ASoC: arizona: Exit startup early if no runtime Mark Brown
2015-12-29 9:46 ` Charles Keepax
2015-12-30 18:05 ` Applied "ASoC: arizona: Exit startup early if no runtime" to the asoc tree Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2015-12-29 9:49 [PATCH] ASoC: arizona: Exit startup early if no runtime Charles Keepax
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1450874881-31458-1-git-send-email-ckeepax@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=jeeja.kp@intel.com \
--cc=lgirdwood@gmail.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.