From: Kuninori Morimoto Date: Mon, 24 Mar 2014 04:23:42 +0000 (-0700) Subject: ASoC: rcar: bugfix: it cares about the non-src case X-Git-Tag: v3.14.28+ltsi~930 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04f0f4f57a142e5f3c8c888bb58d625954c89983;p=platform%2Fkernel%2Flinux-stable.git 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 Signed-off-by: Mark Brown (cherry picked from commit b1eac430b6a4bee6821273d9b41dd3593eb7830b) Signed-off-by: Simon Horman --- diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index eee75eb..6232b7d 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;