From patchwork Thu Jun 16 22:04:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884931 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB145C433EF for ; Thu, 16 Jun 2022 22:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IOmgKm7tJjFy1+5GqlW7H85i0WAk3FLJrYwTbCv2VH0=; b=vhs5QuJwdcNbOx tJUKAwnly0HiZUSGaM7DvfA4p1wa/wX6FjWcQY3vaj1xRZq9CEoRBmiFLyVFZfZIJSQr9NUA8PtT4 nYgr8zqyhRgKf71gRWQ9qpNnZJ2k+pX84pFWezcE/lK1F/BegUtNQMhMubtotzxbqBHISS/QjG+8u WlqWVj0XeCykdjsCXJQ56ijykSY3QzRw0nDrD87ZmoaM2qpZECb8KpdTTPBfc3sAAyXjcROeLjRl2 fQM1XCN434volMkw3dmulUKAoVAv6aTCe1zCMjcOU9ptLkVRD92MVzr8QSxEcke+W1sFaJxqV6pqE qsQdwiKY57U7j6Xp24Fg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1xbh-004XL8-IX; Thu, 16 Jun 2022 22:04:53 +0000 Received: from mga07.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1xbe-004XIt-Ge; Thu, 16 Jun 2022 22:04:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417090; x=1686953090; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SBkbKyAS6K43AKtjdQ9J3OQe/d/Pnk74N8+Pm9fPK3w=; b=b7pSKTUthgQIKKdxIoZouNY/LK4AMZFYreh9Zn5JoI0y+dJoKiWk9CG3 hOmspMrMbeFoGJ40mkvZqo3QWYtLm8gyN59kGXp1hQuiZOdLQnpjFoj62 em0zk3yudS/qNXdu3CjvH4erU8oiKlc4bV+HkXy9d+i3pEMvvDa6xxQKB hx97KKdjLBj1/LKsHLl8Q8CNTT2Km9fJjaAv3nqfAFhlWk/RkYi/ioP7r Q7L/cosm9SxcCS3SwKDY9nVVaGmMTuHHeERbNTREHANdvcCfA7DrTFEM/ LAjcAM/lutBdLMlJN5Oq/7/BsDTBFATJntBinlokuo4x0gnAujTizbFpc A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="343323031" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="343323031" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:46 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728085004" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:45 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Cezary Rojewski , =?utf-8?q?Amadeusz_S=C5=82awi?= =?utf-8?q?=C5=84ski?= , Pierre-Louis Bossart , Bard Liao , Kai Vehmanen , Ranjani Sridharan , Nicolas Frattaroli , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Heiko Stuebner , linux-rockchip@lists.infradead.org (open list:ROCKCHIP I2S TDM DRIVER), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 06/11] ASoC: rockchip: i2s_tdm: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:22 -0500 Message-Id: <20220616220427.136036-7-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220616_150450_633115_0D38B4FC X-CRM114-Status: GOOD ( 10.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org simplify the flow. No functionality change, except that on -EACCESS the reference count will be decreased. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan --- sound/soc/rockchip/rockchip_i2s_tdm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index 48b3ecfa58b46..70542a402477e 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -404,11 +404,9 @@ static int rockchip_i2s_tdm_set_fmt(struct snd_soc_dai *cpu_dai, int ret; bool is_tdm = i2s_tdm->tdm_mode; - ret = pm_runtime_get_sync(cpu_dai->dev); - if (ret < 0 && ret != -EACCES) { - pm_runtime_put_noidle(cpu_dai->dev); + ret = pm_runtime_resume_and_get(cpu_dai->dev); + if (ret < 0 && ret != -EACCES) return ret; - } mask = I2S_CKR_MSS_MASK; switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { From patchwork Thu Jun 16 22:04:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884932 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D3738C43334 for ; Thu, 16 Jun 2022 22:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Vx1ot/1ogI1KlWlI4RlnWTWNqcKdn941EIik45bTAnE=; b=mQvQUGEuoi//NH FrPnsEkamXM2pua0DV0F/EGJQ3CTtb/Rzqn9q/Fb2Xke1CGK/PavDbslfWsN4Pj8Rt3lXMtdYm4lv R0Zjq404lmcl4HQU2yhFpJUcRUPneCryv7RnH7ghq5Zak4vC2GIZ4mK7nA7MwOVFzQCxURrC/FMSW QMSfj1GclBloZYk+eWWBCqlk88WEzyZN5w7iNF+e0sAkDmh3Kndf8g6dYrFA8CGUqLDkPCPvvUIk3 lPnf/sIxu2QdWiQmi2vqSvUI11cr1ReCmk8H3OTho/f6ILH2krDvYP2VhJhy22KuKWP8J+PvCoKXm r8TQuQvZVhskAEMo8NjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1xbr-004XP0-FU; Thu, 16 Jun 2022 22:05:03 +0000 Received: from mga07.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1xbf-004XK2-0l; Thu, 16 Jun 2022 22:04:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417091; x=1686953091; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=16VgkFnDUAPnUMogOVCeb93snA9dZAeCyiMXw7+CLi0=; b=aONNJManeIRNflbM/QNOI6IPL8Z/IHYn1vXVFIn8DTVhfQjN2d6riVL7 7SHaUDVCbFFQ/O1eYARgC1t2i6C6Vhj93ArEu0gBJnzYc0qAm4QIzmTfQ ShjM2RA8/3r41cC+BS2OTS60GGA0foxpwWF4DLw7OeYq6fd3kp8Bliy7G 3Ymt5kPgo1kkJ+DrRJkBccY2K0zwaToSpeydtxnPhJPPxDsnvFKH2Bh1s B+6FnmEfGgEDQM7AVHQfBP95QKIMO9binmJXAezu5bWD636A4QXEwHVN/ 8T7XTqMJLmGFdnQDsU4WtKUDw89gZcoXHQXeyvayKeYD9uSjj2RcwErRz w==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="343323052" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="343323052" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:50 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728085027" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:49 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Cezary Rojewski , =?utf-8?q?Amadeusz_S=C5=82awi?= =?utf-8?q?=C5=84ski?= , Pierre-Louis Bossart , Bard Liao , Kai Vehmanen , Ranjani Sridharan , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Heiko Stuebner , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 09/11] ASoC: rockchip: pdm: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:25 -0500 Message-Id: <20220616220427.136036-10-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220616_150451_137081_A52ABEB9 X-CRM114-Status: GOOD ( 10.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Simplify the flow. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan --- sound/soc/rockchip/rockchip_pdm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 64d9891b6434f..066e29b7879d1 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -688,11 +688,9 @@ static int rockchip_pdm_resume(struct device *dev) struct rk_pdm_dev *pdm = dev_get_drvdata(dev); int ret; - ret = pm_runtime_get_sync(dev); - if (ret < 0) { - pm_runtime_put(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) return ret; - } ret = regcache_sync(pdm->regmap);