From: Kuninori Morimoto Subject: [PATCH] ASoC: rcar: bugfix: it cares about the non-src case Date: Sun, 23 Mar 2014 21:23:42 -0700 (PDT) Message-ID: <87d2hci5rn.wl%kuninori.morimoto.gx@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by alsa0.perex.cz (Postfix) with ESMTP id 714492615EE for ; Mon, 24 Mar 2014 05:23:45 +0100 (CET) Received: by mail-pd0-f181.google.com with SMTP id p10so4746104pdj.26 for ; Sun, 23 Mar 2014 21:23:44 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto , Kuninori Morimoto List-Id: alsa-devel@alsa-project.org From: Kuninori Morimoto src might not exist. kernel will be hung-up without this patch in such case. Signed-off-by: Kuninori Morimoto --- >> Mark This is for mark/topic/rcar branch sound/soc/sh/rcar/src.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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; -- 1.7.9.5