Skip to contentSkip to conversation

ASoC: rcar: bugfix: it cares about the non-src case

PATCH Applied Kuninori Morimoto 2 participants 2 messages Mar 24, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: rcar: bugfix: it cares about the non-src case

From: Kuninori Morimoto <[email protected]>

src might not exist.
kernel will be hung-up without this patch in such case.

---

Quoted 1 line
Quoted 1 line

Mark

This is for mark/topic/rcar branch

 sound/soc/sh/rcar/src.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
sound/soc/sh/rcar/src.c +11 -7
index eee75eb..6232b7d 100644
@@ -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;
 
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw
Quoted 4 lines · Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

src might not exist.
kernel will be hung-up without this patch in such case.

Applied, thanks.