From patchwork Wed Mar 2 10:00:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Ni X-Patchwork-Id: 12765715 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 3551EC433F5 for ; Wed, 2 Mar 2022 10:01:38 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E0F951FEE; Wed, 2 Mar 2022 11:00:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E0F951FEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646215296; bh=h39jAtAKq+dHL8Of/1MnEd7ooWF9tmieOZjKtIFqgbU=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=h4ZBFx8cIBfp2f3E5BiBeozmOqq7JqWXG9D04+hRTLyQOydPazPD/oIGDLx5xZq0F hqn2fVPx1as74NbNwBemWO3yWgiapPc2o1+G2owgQPXcTPFLjCsjVatalW+LzFceCD mY0pK5n3dJi/OiFnXK+dwn8R34gfjOBgnaH7lqfk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7DDC3F80171; Wed, 2 Mar 2022 11:00:46 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 29559F801D5; Wed, 2 Mar 2022 11:00:45 +0100 (CET) Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D8CF2F80167 for ; Wed, 2 Mar 2022 11:00:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D8CF2F80167 X-QQ-mid: bizesmtp77t1646215227tx88lfbo Received: from localhost.localdomain (unknown [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 02 Mar 2022 18:00:22 +0800 (CST) X-QQ-SSF: 0140000000200060D000B00A0000000 X-QQ-FEAT: HoyAXBWgskmYdSdyebFBiWjxCytgNey9Aae4l7NvKJrtYf/1UqQ8fM1QK4I+m CbnWyd2+7bCShdqhan+VzGSRt+cMuQ2hVE19BLeF2n45eNFGihIMAT+Sy7/thMyeEbKosPT IiZpZb1oudFqlhNFHxRlSdmvheplHNsHZQNEG/ogqtjB2cT0C2vJOFJ0282dCG77/IUJGl6 Cs+io3wd/sccnIac73X2G26JYwDYkyvme7CbhDqZ9KasJDw0u0CS+0cWOyl+vx9yJVQq7YT puhiPsxy+48QtjG2NuaK9gkEnDdbaK/q/sthFOqyJPRcEqPfxHpS6ywrzpJT83xyh/4KI+d QD1RaflZwBBf1VSYEaJMwoIm8pNR1g/vYJ3cyTYn8kMbrE7yvc= X-QQ-GoodBg: 2 From: Zhen Ni To: frattaroli.nicolas@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, tiwai@suse.com Subject: [PATCH] ASoC: rockchip: i2s_tdm: fix runtime pm imbalance on error Date: Wed, 2 Mar 2022 18:00:19 +0800 Message-Id: <20220302100019.22891-1-nizhen@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 Cc: Zhen Ni , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Zhen Ni --- sound/soc/rockchip/rockchip_i2s_tdm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index 5f9cb5c4c7f0..4691a76b499d 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -1739,8 +1739,10 @@ static int __maybe_unused rockchip_i2s_tdm_resume(struct device *dev) int ret; ret = pm_runtime_get_sync(dev); - if (ret < 0) + if (ret < 0) { + pm_runtime_put(dev); return ret; + } ret = regcache_sync(i2s_tdm->regmap); pm_runtime_put(dev);