From patchwork Thu Sep 14 20:31:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13386008 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 C3221EEAA71 for ; Thu, 14 Sep 2023 20:31:48 +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=Ixx74YCCplM6SfvrNUlfW+/aOnW/a80lz1VOA1tl9hI=; b=mTcI5aOD9HQxvh Qxw+tRUV2K0ZuHRrEGFa8nQk72nSg9nuQvtTfpTHqcGCSkGDOJ5iLmKvU0lRX6/T8CtLYwmkZUBX1 DTQUS7xhF/Ti2xpvQnavtMzPQFCzQfyL+KC/E7hY/y3rPrT9EhuztblAGpM4QMAyW66MuG7eDmEpZ wna93QdYQjz6Nn+5YKpRXg0LXxfHMGNicuowAj06GPU0JFS74lAyoqLTa5BBLf9MTTN32jdTmP66C 3Xe2OAhAO5TltLa+NQqxaXmKmQuyVWFxJsrgD2gfE8SrPVAqyjWajQcTeUKij5epVRWerHJYAPA4b Rb/HVg+o7E1e2eCXodYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgszl-009EAk-00; Thu, 14 Sep 2023 20:31:25 +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 1qgszf-009E8T-2A for linux-arm-kernel@lists.infradead.org; Thu, 14 Sep 2023 20:31:20 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id gszUqMvFz7mcCgszeqSuie; Thu, 14 Sep 2023 22:31:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1694723478; bh=vDMwGPoL7IUwKLZSj66ABJwQcRH7iJ6OhehhdBpzoGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=H53P1VIqYoTjl1GsFVQAtp1OUqAcTgfxyzCQIi7cOILeyUZmPhDyWJhgyBfbLcBp1 Ytg/siSE+/4EFWOce4lK2PyDFezrBpi2Y403yLVvLp1XBhT+9W2cr+jitk4DWtiqml Ww737IvD6ByWQupws/gWtCOkh4TqrHIWKsP+0Yp0qBJHd624z/ESKvMjFwkE29XY6i IIEO6CUPSk2FdJXq0YBaIWrD6i2/Z9VlX7nqZo8qrrR6ojDVItnZ7K2DAR//iSheYo MY7ePLJMSK5fxMknV83WAokoDP6yHtaUeQAp58i3pkBi3talLLPHzitWCMYxN3G23u esTHVNSH3ybLw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 14 Sep 2023 22:31:18 +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 v2 1/5] clk: imx: imx8: Fix an error handling path in clk_imx_acm_attach_pm_domains() Date: Thu, 14 Sep 2023 22:31:02 +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-20230914_133119_852452_06F7F299 X-CRM114-Status: GOOD ( 12.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 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") Reviewed-by: Peng Fan 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 Thu Sep 14 20:31:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13386009 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 2398FEEAA71 for ; Thu, 14 Sep 2023 20:31:54 +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=Hm9+O0QevwgdaqkyFBSTg67vgY5v1sO5XsMNrSBMI+Y=; b=ui2rQa2ClkVK3a jXSLwSHgVHxQSx2Ov0BwKKQw4NAJiLMyj2mnNPepimVSo/b0MFbELeBd8vdNEB+azYSmPc2HLWaMj lxLNJ55+VA/nBA0jyWhN2yfM7U8LByVzcDXHK8vQH/tfqw10AHFCRgt9u7rhxnZdo59YNMs2HD9Un PHIVVh+NSVWr7CFB6c5iPBy+/X6xG8d1xuEpJ91pZQep8RmiFyRPluoQ/VQnayM+yYkDlcVEvLYtC uGLpwEUj3mM2yAGQ7AXMuCFTM6B6fzTmxjTkyAFzSDhIINmyoqMj7yGUyDXI9PUmVwj+UvfXM/yLb /HW5oX6wWLm1y3jCMA8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgszl-009EB9-21; Thu, 14 Sep 2023 20:31:25 +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 1qgszg-009E8a-1z for linux-arm-kernel@lists.infradead.org; Thu, 14 Sep 2023 20:31:21 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id gszUqMvFz7mcCgszfqSuj1; Thu, 14 Sep 2023 22:31:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1694723479; bh=L4zSBrHMeKtx3k1Cx39Zzdjpsyw54yrC3izyk+zGNhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ATMsMx1XQDh6q4gSJOcwj9KwlnjMBXuJlakUA/vN5iamikjxfr3xTo6ydf3fRJziS yoLAArLg1MaN/b1fxKjOcQiqUZkiIS+YFmLvyuUdb64nqTHQCdc1C1y+9eNyp2KLGp lBiTbaqeoVdBLDz+2XSPipXUEOqwqY/np5ZNKNkcN+y3VXRGEXV3HRsh77h5mbyF9l 8BDO2h7Z8zlrWgAcTSmwg8ZCdhAr+ynFGBmQeNl25k1Kj0qwTmxvSa4lShV1GQdsie QzkPy0R/cGrdHEnneHSjMDE8F8PdI0csvi9bh+4igPUmIuz1ubFruRx9Co/EkTptiD cty6ejsRJQcSg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 14 Sep 2023 22:31:19 +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 v2 2/5] clk: imx: imx8: Fix an error handling path if devm_clk_hw_register_mux_parent_data_table() fails Date: Thu, 14 Sep 2023 22:31:03 +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-20230914_133120_787075_8232D552 X-CRM114-Status: GOOD ( 10.75 ) 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") Reviewed-by: Peng Fan Signed-off-by: Christophe JAILLET --- 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..73b3b5354951 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 Thu Sep 14 20:31:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13386010 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 D6ABFEEAA74 for ; Thu, 14 Sep 2023 20:31:54 +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=rClDg73Iobos3uDJuyg2Snw2CKrVEgb48AULLAuIPR4=; b=byklGB6NKZGNuB jMf38/rPZMBgJtQBH5IQ/M1+9NfGU2IAOeH9lsu48Eq1+dkrp1VvjevKapRvtkLNju+L7ukTh30MZ EVnP3YH+33qLnVSzTy1jWpY26oYmgfhQ+mNr7qIC50oZVNdQIlSEJryDKuTmeG/o0duM6p7WO2cRb 4J/xpTf3HRIhmkb7+hxU/RNBt2/KaP27GFs/DZsVvwSTUAC9zW9OtBQXuLLGOzuX/l4QYdIrgggBr GYQw1m7cKU7WYiNHeI+VSlM7jkUQLDUJV70ilgAgxlrCzHtx797zWocI9iOaceIxNBmDy8ql6oxF+ ym647Wrp73xeiX/Utrzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgszs-009ECf-16; Thu, 14 Sep 2023 20:31:32 +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 1qgszj-009E8s-2C for linux-arm-kernel@lists.infradead.org; Thu, 14 Sep 2023 20:31:25 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id gszUqMvFz7mcCgszgqSujL; Thu, 14 Sep 2023 22:31:20 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1694723480; bh=uJUbD44KFFzWixdbKCNvbFqaLxCfMEIUABC+xCGz+h8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YsX/EaRdLBP85K/6bBP2Aha5OcT3dD8fBN9dwo5VUfI+WskzbbHIhG5SdMV5qrLxq 4mynLaS+CwsO9EC4d2UpwkhaWR+aSXd8iH82HeTiD7GMUb5dIPEtzH4TG4qH4/WgTS LcxbGiDsJiMBiskch95I5TdB1H4uEt4+4NBzSy5kGnLDVu/PEgMtiucXDDUubaQa8k fEQJuagJOCtIHSY48dsi2OF8nqMQhlwAgteuiscn8tqM9CS//lYwicdnkc7pwd0J2z 74tonesYF6Z4mKsSv5+8Zl/MqUDRqDMEFp7MhZdgggnYj2lrClchrqNo0wMtvIYuOz P88jgwDJCB4/A== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 14 Sep 2023 22:31:20 +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 v2 3/5] clk: imx: imx8: Fix an error handling path in imx8_acm_clk_probe() Date: Thu, 14 Sep 2023 22:31:04 +0200 Message-Id: <64da5952f807f37f29f0c4420ac1bde416551a13.1694722339.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-20230914_133123_854652_67B93F3B X-CRM114-Status: GOOD ( 12.16 ) 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") Reviewed-by: Peng Fan Signed-off-by: Christophe JAILLET --- 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 73b3b5354951..1c95ae905eec 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 Thu Sep 14 20:31:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13386011 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 0545EEEAA76 for ; Thu, 14 Sep 2023 20:31:57 +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=Eh5uiBmuZ+I3LqTqdkHBpqmNmss1PRGxFa1acrjYeUU=; b=0xH1yuIaxKo/iW 4s9s3gY9T49iYpefRicmRSR+U/m0cbxlvb8iJPLbCS6XPVe/D3WTMts8Ab0g93iqWTC57FyAdbaeM ZkzLDdpKlnY9ZR2l4ue5rk+6uVAJT7gp/dYWIPCFg6tneh1Yfw/eoRXiW4vBj8Wn1gsVlHpM9eh6P CIT0jj/xbf0i+/Zf6uGbGTVX7qzOEIqnRhqJb7F2At4HMxf9TJcScY7TWz4+ySmgymRYfpMkuuEH8 uPcSSAtntFGZD3BUKO02FslrDAUG4rke5YTngK417cu+nMYbf+cLRmU0Iws6Ihdvp98pe+Qo90nGe qRs+1dPO4cbW4jx4Jqpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgszt-009EDc-1T; Thu, 14 Sep 2023 20:31:33 +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 1qgszi-009E9B-1b for linux-arm-kernel@lists.infradead.org; Thu, 14 Sep 2023 20:31:26 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id gszUqMvFz7mcCgszhqSujj; Thu, 14 Sep 2023 22:31:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1694723481; bh=NmPmvwDti8A6+vjVsHfI78i7GC2N7ByVUqJXUWyMtrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KbMHK1tKAqubigEX7gqvjQPN1a2Wgx4kPtqV64SP8HWfCFo3FNz5rmVOADA5MpXoU jSWY6IXMpVvezcVNjTmfUq8BU3NpOgRQHlzzB5idUFmFnn2Gr/pF2SjltqO8gl7yII 4CLNmZS0Z/PsSNECSWoWjt0M1h5ZozlUx3ohSE12jKbiClkwKzF3nWUyOwLwPbwxBG c9UdcbM7q09zmdUXZB5+fHG3ZNPhnYIxp1kCXs5f5quyimC4yERSw4HjxX2fsF0Usx eP31FbKILpkM4G5BJCvi5VuAdoCQzGhEFfxkicV7Gn4EEsOpHn5Vx9QLCiZ4NjXeIX fAZ3A5eoH30sg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 14 Sep 2023 22:31: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 v2 4/5] clk: imx: imx8: Add a message in case of devm_clk_hw_register_mux_parent_data_table() error Date: Thu, 14 Sep 2023 22:31:05 +0200 Message-Id: <3b883db73c1ad093ea914f008db92738482734a5.1694722339.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-20230914_133122_669403_DF09F31B X-CRM114-Status: GOOD ( 11.44 ) 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") Reviewed-by: Peng Fan 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 1c95ae905eec..c744fb78bb44 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 Thu Sep 14 20:31:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13386012 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 E36F4EEAA6E for ; Thu, 14 Sep 2023 20:31: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=LuWcQIvByuaA06d0Apqi6DzPmN6xhb3yqMAGr51Sr4c=; b=yaduaN5iYLRLA/ U+Yr007RfLJDX4+YSqVaksVLVgVGovqxbaB6pGhRlyXWyfrzjiciIpgPqhoNWkgn2KshTPFdDUiNr hLyatc7tra+56OMbUQMqidzHs1kWgCI7xiVTCPfclHsT0cxcuyJbws/y/pzuEsdPeaofa/jJpTcfI MEyts7qWE6lOKWeh+8wK3PMnZiKBLaMUfjZLFKIjeKNodEAJlV1yKsHpWcZvmIxedz7gotLIMmQTK x+N7/vfKVyvWAmY9wqjeldSV9hu3NQiu3yz3SzMPuWmR8qfQWNVSF9MoL3J3KR0E1UTRy3zD8kObN 3rChTSTeHVphgo7UWMpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qgszs-009EDH-2z; Thu, 14 Sep 2023 20:31:32 +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 1qgszj-009E9L-2D for linux-arm-kernel@lists.infradead.org; Thu, 14 Sep 2023 20:31:26 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id gszUqMvFz7mcCgszhqSuk1; Thu, 14 Sep 2023 22:31:22 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1694723482; bh=c1IUka5tijpIrp0HcvGSlR2aksa59ckg6dwZ4iF3jNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Nq8wEKbOwyagqkhVYlXixP+fuOOqU8zwUvxYo6II81d5G4IkN0J0t3Nf+/UaVUTfw yQh6KOw1za3vgcL8WO9nEpJUo6zZiN2jJxvdDS3kq93kfpDqj01vJEKdW7BrcxHnV6 zRKqvZsvZa0kF9c7uC9fHidpGwVFGtt3SafoXXB//Wo/kyK3EG+1y+nOJmawmnEcV9 X+7Vo/4J/l8Nm4spTLkfl1zKyKkCvG51dtOVQy+ini++O8oMm0iZ7NEX4mCoMTdBly wuLvQzI08zUcZYd+ryss/AoT7/lKvx8BgD4QSLuksdc2c2JELJgKLnoLS474/Rx72p TK4vxugtfiFpw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 14 Sep 2023 22:31:22 +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 v2 5/5] clk: imx: imx8: Simplify clk_imx_acm_detach_pm_domains() Date: Thu, 14 Sep 2023 22:31:06 +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-20230914_133123_992527_F6B21CA6 X-CRM114-Status: GOOD ( 12.34 ) 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() is never used. Simplify the code and turn it into a void function. Reviewed-by: Peng Fan 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 c744fb78bb44..735b08296cc8 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)