From patchwork Thu Oct 30 05:08:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 5193531 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 583429F349 for ; Thu, 30 Oct 2014 05:50:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 969EB20320 for ; Thu, 30 Oct 2014 05:50:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1BB3E202F8 for ; Thu, 30 Oct 2014 05:50:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0A356265200; Thu, 30 Oct 2014 06:50:27 +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, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 88A7E265071; Thu, 30 Oct 2014 06:49:47 +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 D0AF6264ED5; Thu, 30 Oct 2014 06:49:42 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by alsa0.perex.cz (Postfix) with ESMTP id 5DA2A260615 for ; Thu, 30 Oct 2014 06:49:34 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 29 Oct 2014 22:47:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,283,1413270000"; d="scan'208";a="598804869" Received: from vkoul-udesk3.iind.intel.com (HELO localhost.localdomain) ([10.223.96.11]) by orsmga001.jf.intel.com with ESMTP; 29 Oct 2014 22:49:31 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Thu, 30 Oct 2014 10:38:54 +0530 Message-Id: <1414645736-24426-2-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1414645736-24426-1-git-send-email-vinod.koul@intel.com> References: <1414645736-24426-1-git-send-email-vinod.koul@intel.com> Cc: Vinod Koul , broonie@kernel.org, subhransu.s.prusty@intel.com, lgirdwood@gmail.com Subject: [alsa-devel] [PATCH 1/3] ASoC: Intel: mrfld: Fix runtime pm calls in sst_open_pcm_stream 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 From: Subhransu S. Prusty It's already done in open/close. Signed-off-by: Subhransu S. Prusty Signed-off-by: Vinod Koul --- sound/soc/intel/sst/sst_drv_interface.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/intel/sst/sst_drv_interface.c b/sound/soc/intel/sst/sst_drv_interface.c index 183b1eb..4187057 100644 --- a/sound/soc/intel/sst/sst_drv_interface.c +++ b/sound/soc/intel/sst/sst_drv_interface.c @@ -163,16 +163,11 @@ static int sst_open_pcm_stream(struct device *dev, if (!str_param) return -EINVAL; - retval = pm_runtime_get_sync(ctx->dev); - if (retval < 0) - return retval; retval = sst_get_stream(ctx, str_param); - if (retval > 0) { + if (retval > 0) ctx->stream_cnt++; - } else { + else dev_err(ctx->dev, "sst_get_stream returned err %d\n", retval); - sst_pm_runtime_put(ctx); - } return retval; } @@ -212,7 +207,8 @@ put: stream->period_elapsed = NULL; ctx->stream_cnt--; - sst_pm_runtime_put(ctx); + if (retval) + dev_err(ctx->dev, "free stream returned err %d\n", retval); dev_dbg(ctx->dev, "Exit\n"); return 0;