From patchwork Mon Mar 24 04:23:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 3881211 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BEBBE9F334 for ; Mon, 24 Mar 2014 04:24:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 009B620263 for ; Mon, 24 Mar 2014 04:24:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BE95B201BF for ; Mon, 24 Mar 2014 04:24:04 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 91EA426168D; Mon, 24 Mar 2014 05:24:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6FCAA261609; Mon, 24 Mar 2014 05:23:53 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9875E261616; Mon, 24 Mar 2014 05:23:52 +0100 (CET) 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:subject:user-agent:mime-version:to:cc :content-type; bh=G9tY+DvVpbdWWmVij62DveSBG17vehaRjieprLQno0k=; b=GyrE/f0dVd7MU6DdKGYfm1aw8i/4gqnDE0c/xqMttcZIB8dVtStvgd1VweQ8XdyFhl os26KNUgoKeu+neJGKXFO6Fp6HjJaRdByJuieRjoC/PKgtMIvneyn180jKTvF+BkZDIo s8DL4hKzqK8eRe6cirn+54fpTlAxdIR0avw7kbrai3boSa9zvIRopFsrOdtIYvsSxwaz +CaTWXuNhZ8fdsH+Y6MRReC4ufcOGUBT+LQ/a8CLkpxDjUC9bIXKRadPXNSLKNzcjnlG PCQesyH2L21UVFHKgIfXQLr62YW56teCJGCTM0skLTMPr4UT8rq8AkopBwTCZ6+01KJ0 k8vQ== X-Received: by 10.66.21.73 with SMTP id t9mr13434483pae.36.1395635023645; Sun, 23 Mar 2014 21:23:43 -0700 (PDT) Received: from morimoto-dell.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id ha11sm30422559pbd.17.2014.03.23.21.23.41 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 23 Mar 2014 21:23:42 -0700 (PDT) Date: Sun, 23 Mar 2014 21:23:42 -0700 (PDT) Message-ID: <87d2hci5rn.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") To: Mark Brown Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto , Kuninori Morimoto Subject: [alsa-devel] [PATCH] ASoC: rcar: bugfix: it cares about the non-src case X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" 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 X-Virus-Scanned: ClamAV using ClamSMTP 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;