From patchwork Sun Aug 27 09:37:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13366895 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 DE1A6C83F11 for ; Sun, 27 Aug 2023 09:38:43 +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=tb8HRBKCvtAiD/NH/F7M1Y7byCOfAnbm3ZDb9pq/vqs=; b=RJR2vXpRS9uYzy ZO2ihJSqwhWzREUcoMNrFMl79tQ4SVwK4YCngPD+5uMBsCBjLjvxc4ZHUuGAYfaBGflCVwBkBYKOL WyZNM2o0CGm3bBL0V5pMqDwmwHtwVL2T84QlrQbNApCwelsRM6thshtqLP9cgvEWj1BdtnD6/K0RA cbLy4JePky/TII7o6FzP8Ky/AbaCeWtUlwhW6IUjUN5FFhszrUnzfD+swa0eF3G+h14cuPDv3hCvG hzxevt3UfMd6ax2NEUWBqlfPJlZop4Ke1IqoGPUUMVhK2XG1hFLKOn4r8DKtgRtOYQi8mmTGWj7CN bc9TBD+lMvD43QlR2/Bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qaCDs-007kEU-2L; Sun, 27 Aug 2023 09:38:20 +0000 Received: from smtp-16.smtpout.orange.fr ([80.12.242.16] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qaCDq-007kE9-0z for linux-arm-kernel@lists.infradead.org; Sun, 27 Aug 2023 09:38:19 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id aCDYqs7H09KIfaCDoq3nY7; Sun, 27 Aug 2023 11:38:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1693129097; bh=piFugZHMLuSIS9b+Rv/FmdqkIddGgweuSK0getmdWiQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YJ7XAJ3+B+BiabruVyPjt4PsGR3SEyI6KA0N9ZzKe1O7WTLRY7+zI5tUkCIBTuA5t bZlYskYXbE0zGWWPU3nokcAl/cDDfnn3G3xe1ePsfo/Z1U3EjGHWM24bdc2xO0+Gyp lKyqco2d0LCAV5ijqFVthSYu3TktErkNQj7GhLqHUJFDaR3dcks7n2k9uk032IOZ0p nZMtMcMgJZvQ3N3wg6qAQvg+yrT1pFg6mln7VCkDxfF1+VREHmM8HZErGNYIylbxby TBigHzrjqAsU5YdeolnqtnxbT5BJqICZdrm1SBB9bq2spVbUmfRH+7gA8rGANPYxzc bbT8mV+3w3fEQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 27 Aug 2023 11:38:17 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, shengjiu.wang@nxp.com Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 1/5] clk: imx: imx8: Fix an error handling path in clk_imx_acm_attach_pm_domains() Date: Sun, 27 Aug 2023 11:37:52 +0200 Message-Id: <84ba2f52d43887f954d26a784bd576f20587320f.1693126687.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230827_023818_477802_D9B59D3E X-CRM114-Status: GOOD ( 11.65 ) 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 If a dev_pm_domain_attach_by_id() call fails, previously allocated resources need to be released. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Signed-off-by: Christophe JAILLET --- drivers/clk/imx/clk-imx8-acm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c index 1e82f72b75c6..87025a6772d0 100644 --- a/drivers/clk/imx/clk-imx8-acm.c +++ b/drivers/clk/imx/clk-imx8-acm.c @@ -279,8 +279,10 @@ static int clk_imx_acm_attach_pm_domains(struct device *dev, for (i = 0; i < dev_pm->num_domains; i++) { dev_pm->pd_dev[i] = dev_pm_domain_attach_by_id(dev, i); - if (IS_ERR(dev_pm->pd_dev[i])) - return PTR_ERR(dev_pm->pd_dev[i]); + if (IS_ERR(dev_pm->pd_dev[i])) { + ret = PTR_ERR(dev_pm->pd_dev[i]); + goto detach_pm; + } dev_pm->pd_dev_link[i] = device_link_add(dev, dev_pm->pd_dev[i], From patchwork Sun Aug 27 09:37:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13366896 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 9F298C83F11 for ; Sun, 27 Aug 2023 09:38:50 +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=e9pzCP2qxqV/+UQ8b+sxeWRq35xHIWmHVliWEycMHiI=; b=ic44cFUamrHXkB gJDFYYr7tzXwg6/uxcFIN8YGMZIknta24RObw7hJrf3J/PwUJyfrsQlNQXXCE8PyZhpxTFslx7ScT a4Jz5M5CVrVeO/Ix+FoYGeC0y3mXvVfIkrcu2xy5aj5XMeYDkKLwwIKx7IcTzMLTOrc9QaNd8ghrf IVVeGpc8u+8DgA0kJ+TQ84APJrGjY6f4cQfmYJ/0qnlgMwrQZl/WgdWGsGWt3DCpsWznZPUw3oEUM V5D2TAsTjLHrYmnvCfezZhRoz/ZTwJe8aqfv3Bt9Cm4Yh6ZxzPmK8GsUPTFyTTWC6dRpcJP2mza8q nsVMePx599Nd3DNNU7xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qaCE1-007kGB-1Y; Sun, 27 Aug 2023 09:38:29 +0000 Received: from smtp-16.smtpout.orange.fr ([80.12.242.16] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qaCDu-007kEp-1c for linux-arm-kernel@lists.infradead.org; Sun, 27 Aug 2023 09:38:23 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id aCDYqs7H09KIfaCDtq3nYr; Sun, 27 Aug 2023 11:38:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1693129101; bh=qhuQ6UNsFUTemQzGujstryJyMiE4Em6qSWkpxgpWDqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DmXSgHOSFNiAOlGSQRm/3mR0BBWewJyG3gQrTv5gPGt12LklZqc0KIFph5X0/zrpU uzfu8+7vVNeej1qCEdwbVDpVzpbl4C8lycjMf/TkKF4uTiejqCAA2GpFpcwIrapAXY GqtIgaopOWS8rK6W899cKGzD4FDCV8ThCJYvWNCzqibNp9hWdzYobkvd+22X8rtZav uuUVwiDT7RwGOTKB3eP/edYGz90Stb4EX8FgH+mh9tdCLH/v+pRrH1TmeFg+4FvFId TbcEPYTkKIyY6cQF0ZPeDxgjdVxB1WaxsUeMUJd/HFYV1MTLP7TwVsGQYyPWdBj4of iYtrtFigrD4sg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 27 Aug 2023 11:38:21 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, shengjiu.wang@nxp.com Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/5] clk: imx: imx8: Fix an error handling path if devm_clk_hw_register_mux_parent_data_table() fails Date: Sun, 27 Aug 2023 11:37:53 +0200 Message-Id: <6bd11f11ccbf23bb6735daf3b3780f1f24528647.1693126687.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230827_023822_672944_840CDBF5 X-CRM114-Status: GOOD ( 10.54 ) 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 If a devm_clk_hw_register_mux_parent_data_table() call fails, it is likely that the probe should fail with an error code. Set ret before leaving the function. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Signed-off-by: Christophe JAILLET --- This patch is speculative, review with care. --- drivers/clk/imx/clk-imx8-acm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c index 87025a6772d0..0cd9aa3629f3 100644 --- a/drivers/clk/imx/clk-imx8-acm.c +++ b/drivers/clk/imx/clk-imx8-acm.c @@ -373,6 +373,7 @@ static int imx8_acm_clk_probe(struct platform_device *pdev) sels[i].shift, sels[i].width, 0, NULL, NULL); if (IS_ERR(hws[sels[i].clkid])) { + ret = PTR_ERR(hws[sels[i].clkid]); pm_runtime_disable(&pdev->dev); goto err_clk_register; } From patchwork Sun Aug 27 09:37:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13366897 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 5CB94C83F01 for ; Sun, 27 Aug 2023 09:38:58 +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=Oz0jGbkt2hGsF+Yk6okzTSmIbEW6C6NX+imJ/rVBAuQ=; b=DHX2ceDqcTOQUg Cf1oJsDNwcZs75wGgxZJfa71wfZVgfR00deBNW4eFjCqaD8lAnWVXGp4IWff4NtCBMCHFOH2sjfB4 HT0Afrgv7GA4n7Gevr51P12Wstc5lMJ7Y1chKG2Qs01m1ShTKMgB0EM/tcVrQazS9C/zsqkmw3twk nyETuH34K50V9QX5rA02Q0yHkiI0ujRQgaeHNvoZSX46qkZAhU/5+6dk1rqUTkgkl9/Pt7QcMXpWF Antxgp0C+6kdE2yN+UyWLufaSfruVu7ZpMIlg2WNHYZsjBvxw6bl1CMOgTNN2Cj9PfsQwX71w8cl3 e1CMuFP5ojwuWd11oi1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qaCEA-007kIu-0h; Sun, 27 Aug 2023 09:38:38 +0000 Received: from smtp-15.smtpout.orange.fr ([80.12.242.15] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qaCDz-007kFZ-2W for linux-arm-kernel@lists.infradead.org; Sun, 27 Aug 2023 09:38:29 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id aCDYqs7H09KIfaCDxq3na4; Sun, 27 Aug 2023 11:38:25 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1693129105; bh=I6DfPJLjRMXd5IakoD9Cs1Y4bITISq9Vs0SLJnQFqZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hqotYqNZ7+Lb9zpuQe/7IGIaXgdHXl142eKk6OuVwfKjh1Fr3OD8vrRCx3DVMUFtO juL3qA4px/KLjNLignVmc5cCEZNmzRrcXaiWo/+n9UxirARxaIty5PEuHvqvyhf5fe L/2I5nlLA4j4raZlusP4/evTQ7ZoR4G7MdWGEddNDz06cqjWbkDaeFqHXgUT9aM0JJ B3smEwbAHN4n6frMLoJZG6tLhs50BPGCh5uhgnPlo2YrR+pSAW/Ls0JOXd3pnhPZ7g WnXkSQk9qq+3MDMcO9HlUcUoLm66jM9lZLDV99Uvd3QchIx8ZSIKXNlXSacqShJYag inDyKrYwnYt8g== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 27 Aug 2023 11:38:25 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, shengjiu.wang@nxp.com Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 3/5] clk: imx: imx8: Fix an error handling path in imx8_acm_clk_probe() Date: Sun, 27 Aug 2023 11:37:54 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230827_023827_955443_70C06FFE X-CRM114-Status: GOOD ( 11.95 ) 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 If an error occurs after a successful clk_imx_acm_attach_pm_domains() call, it must be undone. Add an explicit error handling path, Re-order the code and add the missing clk_imx_acm_detach_pm_domains() call. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Signed-off-by: Christophe JAILLET --- This patch is speculative, review with care. --- drivers/clk/imx/clk-imx8-acm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c index 0cd9aa3629f3..19914c1d7c39 100644 --- a/drivers/clk/imx/clk-imx8-acm.c +++ b/drivers/clk/imx/clk-imx8-acm.c @@ -374,7 +374,6 @@ static int imx8_acm_clk_probe(struct platform_device *pdev) 0, NULL, NULL); if (IS_ERR(hws[sels[i].clkid])) { ret = PTR_ERR(hws[sels[i].clkid])); - pm_runtime_disable(&pdev->dev); goto err_clk_register; } } @@ -384,12 +383,16 @@ static int imx8_acm_clk_probe(struct platform_device *pdev) ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data); if (ret < 0) { dev_err(dev, "failed to register hws for ACM\n"); - pm_runtime_disable(&pdev->dev); + goto err_clk_register; } -err_clk_register: + pm_runtime_put_sync(&pdev->dev); + return 0; +err_clk_register: pm_runtime_put_sync(&pdev->dev); + pm_runtime_disable(&pdev->dev); + clk_imx_acm_detach_pm_domains(&pdev->dev, &priv->dev_pm); return ret; } From patchwork Sun Aug 27 09:37:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13366899 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 B6364C83F11 for ; Sun, 27 Aug 2023 09:39:04 +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=p+of7A/cSSKzCCUuhUgdoMC0Fjvx68PzhMfTdCy1M6s=; b=yhwMd6tJ9upSqX ZLN9SDT5AAe9MzsIT4WX31mmnBTz/z466cYbcAPtRDdHZvVjio4GUc7EYHhGvVt3ct4g8zuig7255 EAUXflRfWin9houLc3sPNwNUCCLh/EHiD42EGfPAup7+jG8YUHPGRaVFkU/UcexRZ54D2hlPSo870 2ojUVsQjz5OlubYdTawaODWQidiNNJkryOpWqAWCidxsCX4UQyHSIFsO3Z1pxZ4iF5I7kUwuHrDrM VYmAteJEwP0GYLWyxR9B6+/oOl8cJ6XqLzptQGdRiRJIsK620NlWmLxw5/b+AauBcgWjSNqr7ueOl GvzKLiWEgt3RRRe2theg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qaCEA-007kJI-2F; Sun, 27 Aug 2023 09:38:38 +0000 Received: from smtp-15.smtpout.orange.fr ([80.12.242.15] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qaCE2-007kGS-2Z for linux-arm-kernel@lists.infradead.org; Sun, 27 Aug 2023 09:38:32 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id aCDYqs7H09KIfaCE1q3naj; Sun, 27 Aug 2023 11:38:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1693129109; bh=i5qoU1N0Ijqq+IRjIQaG9uUkOL+C8Y0RRn+B9L4Ow7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rOBttUZYKGhbmMprEne7+McQ0FBU3WSbssxOHdFLcpJ31dcw0+EEhZd4vy3uwAd0V YhYpN1PqH95lKqoaC8dOxYp2jbSncOacMIb57yMiD052ZIUGdfSJ3/zL+F16pCPTfx xLOXQn9/QohJfQoN/1/j/eX5g9+5cjOLW65osmAK/kZ2mp7dGKPj6gwJcBksJsL8DO MmKY5n/4e+AUTPKacSkIR3yz57kw1oyy7/5pq/HtD0Cv/o6NF5Z80mT9cyHjLAKASO c8jEGxiOzLipdqobaf0HJqbXqapCm8Tfe87ibX/vCbfmK4YJaZGPpOBY9krMDHku/Z bMFqFQts0sRjw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 27 Aug 2023 11:38:29 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, shengjiu.wang@nxp.com Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 4/5] clk: imx: imx8: Add a message in case of devm_clk_hw_register_mux_parent_data_table() error Date: Sun, 27 Aug 2023 11:37:55 +0200 Message-Id: <92d1e1355a216b1304a9d988aaa499553528a3b9.1693126687.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230827_023830_969626_76025224 X-CRM114-Status: GOOD ( 11.06 ) 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 If devm_clk_hw_register_mux_parent_data_table() fails, we branch to the error handling path and imx_check_clk_hws() is never called. Actually, imx_check_clk_hws() is a no-op because values in hws are either valid, either NULL. Move the call to imx_check_clk_hws() in the error handling path, so that an error is logged. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Signed-off-by: Christophe JAILLET --- drivers/clk/imx/clk-imx8-acm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c index 19914c1d7c39..33157bc706ae 100644 --- a/drivers/clk/imx/clk-imx8-acm.c +++ b/drivers/clk/imx/clk-imx8-acm.c @@ -374,12 +374,11 @@ static int imx8_acm_clk_probe(struct platform_device *pdev) 0, NULL, NULL); if (IS_ERR(hws[sels[i].clkid])) { ret = PTR_ERR(hws[sels[i].clkid])); + imx_check_clk_hws(hws, IMX_ADMA_ACM_CLK_END); goto err_clk_register; } } - imx_check_clk_hws(hws, IMX_ADMA_ACM_CLK_END); - ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data); if (ret < 0) { dev_err(dev, "failed to register hws for ACM\n"); From patchwork Sun Aug 27 09:37:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13366898 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 4A91BC83F11 for ; Sun, 27 Aug 2023 09:39:02 +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=D6u7H3J239PzKIMyBS0N3AHyX7Ochb4OFRuyFi5QQ6I=; b=RSR0FaojI9kMff R9P2LsxzT8tXXhl/UjO4E/23vZ41gBXj2jd8gk4eG1hWP8USpERytfkqNGBvZkkBXFgTCBMmmBKX5 OQywNphWmA3sGr4UM1H5Rp8iahYLu6a7p6MXGAK+bloUwBXgNqo1rFbEHRSoglw1Iu2vHSDsHapUJ F8sC3VMYzNu0NCgb9ghHHU4SJ+GlaFuinA5lXWW5mhJzXvysP9yp51iBz3RAxhfS1B/j8mTGpgzjM ckoDNn/CbN53OqUK7q9DNaOnX5pi812sPXvxRrGWwNdehb426z/k3eykXTxcHIy9kHp0S04cgUKtt gKIctp+SHpMTOYfrT94A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qaCEB-007kJj-0h; Sun, 27 Aug 2023 09:38:39 +0000 Received: from smtp-15.smtpout.orange.fr ([80.12.242.15] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qaCE6-007kHM-0n for linux-arm-kernel@lists.infradead.org; Sun, 27 Aug 2023 09:38:35 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id aCDYqs7H09KIfaCE4q3nb5; Sun, 27 Aug 2023 11:38:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1693129113; bh=+P4qXG0DNFgTzSGfPFxL6rolcGOhTs7nFhwTKxuBpPo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=e6GGeHkclzkSFZH7b6d6bA40oWV879quuR7gMm0OtFDdxiowVxHxfUZX1s7d07Leb DEJp+gg/Gpf25duCNb11870Z4mHvaKw6tJf2E4LebCkZ3RIR7kJ58aY9RpoRDflVH1 QGnGlABHepua5oBa8YUlSsaoOKaW/tzFUAOT92VPQdlKZodOlrU64tNjzBz/9iLjaK T13d+u6IKBC0Jb7QSga2ltLIpcytHTAG/hW1V7c6vCRq1NCe76ymUimiCdjXSDJQBf YTi2VzcGJWyP6uA68pxqmY4h9el5F8EW/Y/UUp9947zjRxrIgrVlGpx4a6+sYIVIoV OAKxmTCEWmzkA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 27 Aug 2023 11:38:33 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: abelvesa@kernel.org, peng.fan@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, shengjiu.wang@nxp.com Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 5/5] clk: imx: imx8: Simplify clk_imx_acm_detach_pm_domains() Date: Sun, 27 Aug 2023 11:37:56 +0200 Message-Id: <9046676220e3f5362d3aa638cb5cd4ffcbae797d.1693126687.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230827_023834_419139_C2C5BFF4 X-CRM114-Status: GOOD ( 11.68 ) 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 The return value of clk_imx_acm_detach_pm_domains() never used. Simplify the code and turn it into a void function. Signed-off-by: Christophe JAILLET --- drivers/clk/imx/clk-imx8-acm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c index 33157bc706ae..2c920091d678 100644 --- a/drivers/clk/imx/clk-imx8-acm.c +++ b/drivers/clk/imx/clk-imx8-acm.c @@ -310,20 +310,18 @@ static int clk_imx_acm_attach_pm_domains(struct device *dev, * @dev: deivice pointer * @dev_pm: multi power domain for device */ -static int clk_imx_acm_detach_pm_domains(struct device *dev, - struct clk_imx_acm_pm_domains *dev_pm) +static void clk_imx_acm_detach_pm_domains(struct device *dev, + struct clk_imx_acm_pm_domains *dev_pm) { int i; if (dev_pm->num_domains <= 1) - return 0; + return; for (i = 0; i < dev_pm->num_domains; i++) { device_link_del(dev_pm->pd_dev_link[i]); dev_pm_domain_detach(dev_pm->pd_dev[i], false); } - - return 0; } static int imx8_acm_clk_probe(struct platform_device *pdev)