From patchwork Mon May 25 08:58:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dinghao Liu X-Patchwork-Id: 192604 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5067C433DF for ; Mon, 25 May 2020 09:33:08 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 61C212071A for ; Mon, 25 May 2020 09:33:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="tdjS9i2M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61C212071A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zju.edu.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 C40C3172D; Mon, 25 May 2020 11:32:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C40C3172D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1590399186; bh=zerTkJBHTSQa4CDWGG4ozUv0nrrSLVlk5sUFtSj8Om0=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=tdjS9i2Mx49XH49CTkWct7VK8PpSCMmVFFyoqsubhQ35oVjaWYlBIWROLg0Z4xDLK WR4H/4NziVz43UxTV3Oy/sMRepUS5qclLg6vRcu/NUoK6wPgg3HcYu8gMVJl1VDfsQ Zwxq50p8RTWkHMU9WdmgZgxzfJBmhpuZfMMmQkrE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5C3DCF802FF; Mon, 25 May 2020 11:25:31 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A08BBF8016F; Mon, 25 May 2020 10:59:12 +0200 (CEST) Received: from zju.edu.cn (spam.zju.edu.cn [61.164.42.155]) by alsa1.perex.cz (Postfix) with ESMTP id 56CE2F8014A for ; Mon, 25 May 2020 10:58:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 56CE2F8014A Received: from localhost.localdomain (unknown [222.205.77.158]) by mail-app4 (Coremail) with SMTP id cS_KCgB3EATJiMteScwEAA--.13210S4; Mon, 25 May 2020 16:58:52 +0800 (CST) From: Dinghao Liu To: dinghao.liu@zju.edu.cn, kjlu@umn.edu Subject: [PATCH] [v2] ASoC: ti: Fix runtime PM imbalance in omap2_mcbsp_set_clks_src Date: Mon, 25 May 2020 16:58:48 +0800 Message-Id: <20200525085848.4227-1-dinghao.liu@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: cS_KCgB3EATJiMteScwEAA--.13210S4 X-Coremail-Antispam: 1UD129KBjvdXoWrKw4UCw4UCF45tryfWFWkXrb_yoWDXFXE9a 1Durn8Zr9Fyr42k3yjya909a4SvFWDCr1DGrZ2qr47tFWUCr1rKF1rAFnxur43W3y8uryU JwnY9F9xAFyjkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb-xFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AK wVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20x vE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26rxl6s0DM28EF7xvwVC2z280 aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07 x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15 McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr4 1lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2IY04v7MxkIecxEwVAF wVW8ZwCF04k20xvY0x0EwIxGrwCF04k20xvE74AGY7Cv6cx26r4fKr1UJr1l4I8I3I0E4I kC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWU WwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr 0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWr Jr0_WFyUJwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r 4UJbIYCTnIWIevJa73UjIFyTuYvjfUOnmRUUUUU X-CM-SenderInfo: qrrzjiaqtzq6lmxovvfxof0/1tbiAgEJBlZdtORShQA4s4 X-Mailman-Approved-At: Mon, 25 May 2020 11:25:08 +0200 Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Peter Ujfalusi , Mark Brown , Jarkko Nikula 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" When clk_set_parent() returns an error code, a pairing runtime PM usage counter increment is needed to keep the counter balanced. Signed-off-by: Dinghao Liu --- Changelog: v2: - Fix this in a cleaner way. --- sound/soc/ti/omap-mcbsp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c index 3d41ca2238d4..d7406cc3c2a5 100644 --- a/sound/soc/ti/omap-mcbsp.c +++ b/sound/soc/ti/omap-mcbsp.c @@ -77,18 +77,15 @@ static int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id) pm_runtime_put_sync(mcbsp->dev); r = clk_set_parent(mcbsp->fclk, fck_src); - if (r) { + if (r) dev_err(mcbsp->dev, "CLKS: could not clk_set_parent() to %s\n", src); - clk_put(fck_src); - return r; - } pm_runtime_get_sync(mcbsp->dev); clk_put(fck_src); - return 0; + return r; } static irqreturn_t omap_mcbsp_irq_handler(int irq, void *data)