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: 12884928 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 E3E75CCA47A for ; Thu, 16 Jun 2022 22:05:12 +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=fJbz9MrtZiukoxaoN9Q49L5xdiuh2WMEV4T1QkOMWmU=; b=mT2q9/OXlaPHXA B/xA7E+WeZLASfec7yuogs196mX01mMQAs1AH1O/idjmPP1oSYZjyvbf8DiYAOTCs63wNyvV7iiyv rqbdymBmN5GT14Ldu+Wz2MjTauk9fRS4JPH8uygfw8zLFuGqGf0t2Eg019uL9yXBp+PaGuwbuNEc7 ZYYrovSfdnV3G7wY3+rS/c3S3swo/O4ycy3UU9854sFTYEwxgAMWoP1FOulI1/Bxi97Y9Pz1hJSnv sUlFW510jr4CeVZjKgfkU8Px5lDksZsc97z2f5hzl6pjeElDKFW+v9/iy0eqt5JI6/cWG24yec0vz oH/IJsfYi76OKeDElKEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1xbq-004XOt-Hb; Thu, 16 Jun 2022 22:05:02 +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-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=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) {