From patchwork Wed Mar 5 12:17:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 3774161 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 85900BF13A for ; Wed, 5 Mar 2014 12:17:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE13C20221 for ; Wed, 5 Mar 2014 12:17:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DFB1620220 for ; Wed, 5 Mar 2014 12:17:40 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7DF212650EE; Wed, 5 Mar 2014 13:17:38 +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.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id A4B572650EE; Wed, 5 Mar 2014 13:17:29 +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 6B9962650FE; Wed, 5 Mar 2014 13:17:27 +0100 (CET) Received: from smtp-out-014.synserver.de (smtp-out-163.synserver.de [212.40.185.163]) by alsa0.perex.cz (Postfix) with ESMTP id 235D826501B for ; Wed, 5 Mar 2014 13:17:20 +0100 (CET) Received: (qmail 9292 invoked by uid 0); 5 Mar 2014 12:17:19 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 9152 Received: from p4fe61bd7.dip0.t-ipconnect.de (HELO lars-adi-laptop.analog.com) [79.230.27.215] by 217.119.54.77 with SMTP; 5 Mar 2014 12:17:18 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Wed, 5 Mar 2014 13:17:44 +0100 Message-Id: <1394021868-11860-3-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1394021868-11860-1-git-send-email-lars@metafoo.de> References: <1394021868-11860-1-git-send-email-lars@metafoo.de> Cc: Viresh Kumar , alsa-devel@alsa-project.org, Lars-Peter Clausen Subject: [alsa-devel] [PATCH 3/7] ASoC: Fix active count tracking for CODEC to CODEC links 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP For CODEC to CODEC links we need to make sure to also manage the 'active' field of the cpu_dai CODEC. Signed-off-by: Lars-Peter Clausen --- sound/soc/soc-pcm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 1a98575..71a01dd 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -61,7 +61,9 @@ void snd_soc_runtime_activate(struct snd_soc_pcm_runtime *rtd, int stream) cpu_dai->active++; codec_dai->active++; - rtd->codec->active++; + if (cpu_dai->codec) + cpu_dai->codec->active++; + codec_dai->codec->active++; } /** @@ -91,7 +93,9 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream) cpu_dai->active--; codec_dai->active--; - rtd->codec->active--; + if (cpu_dai->codec) + cpu_dai->codec->active--; + codec_dai->codec->active--; } /**