aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto2014-03-23 21:23:42 -0700
committerMark Brown2014-03-24 10:42:26 +0000
commitb1eac430b6a4bee6821273d9b41dd3593eb7830b (patch)
treedb49b2fa7d9eb4d292f9ed59c152878060075ce5 /sound
parent90e8e50fce3585d6f9902701de08389b027dadc6 (diff)
ASoC: rcar: bugfix: it cares about the non-src case
src might not exist. kernel will be hung-up without this patch in such case. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/sh/rcar/src.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index eee75ebf961c..6232b7d307aa 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -182,16 +182,20 @@ unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv,
struct rsnd_dai_stream *io,
struct snd_pcm_runtime *runtime)
{
+ struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io);
struct rsnd_src *src;
- unsigned int rate;
+ unsigned int rate = 0;
- src = rsnd_mod_to_src(rsnd_io_to_mod_src(io));
+ if (src_mod) {
+ src = rsnd_mod_to_src(src_mod);
+
+ /*
+ * return convert rate if SRC is used,
+ * otherwise, return runtime->rate as usual
+ */
+ rate = rsnd_src_convert_rate(src);
+ }
- /*
- * return convert rate if SRC is used,
- * otherwise, return runtime->rate as usual
- */
- rate = rsnd_src_convert_rate(src);
if (!rate)
rate = runtime->rate;