From patchwork Tue Dec 17 21:41:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 13912573 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 28468E77184 for ; Tue, 17 Dec 2024 21:45:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1wAwt9inLv6RNZzfXu+D3JjFm+HHPD/dN1XB8Rawcdo=; b=3exS/oJOVFO44pkfnOF//ndcl+ fHTnMYxnUqp6nCvJIMUXpzJi1A1xaaL9wHFMukcVZ9M7c1BLzOSb6h9DJlIOAgUbt02ifyB7CAgjA IIRQWxr4j7v5QD/9NxPJrKh/tVdX5/XRxtKhOhEgzsDPGDnwECuWNFRXCjLkJ+UX8qfNGST5l3Usb qzVPdNSIc4DJNnD3bFh54wTOfttRU+j7TMdlsfhcK61rp+YYpWwMMXQsFtBMfDpHoZA2QrM6R60+U mCAS+91GoazJjcwvogdkSVzja+99f5G1ileUJOWV7yMe+uWeaBR15YyCqAxVhRIzL+5mN211jwMMZ FZnDz5Kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNfNv-0000000EuTU-1CVT; Tue, 17 Dec 2024 21:45:43 +0000 Received: from bali.collaboradmins.com ([148.251.105.195]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNfKw-0000000Etx9-3KIq; Tue, 17 Dec 2024 21:42:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1734471757; bh=+ppoxTPO/igxME3lIs+D7CFzw+ePdaoHzXKCgEyp3Ig=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=awNT39teoZUlKdCTS+iX7cR8Jk9hisY0G7DDaOQGw+4aeF8A2jgFRkNw76A+2kF95 dQltQIz9+U6UaeBPi5qUrll2Lv8Juzy1wow6/YFo9ETmvfO2QXxFOCVJncEI1KOZya TeoqymqT0jEiezxCnsIAwJr/f3EU1/xLv508z8eWzE82vAePXX9ljCpF0a8dSHaVXy lpwobz0jAz6HgXxR1Uh/p2GTe4uhWX+lNhrKGpz13YO1kXfpxL317Iu0AlrH9xZjIY XX+wiOi0FdDzk0ghOXXhOcD/e3EusO8hiyIhkiWCJuFuzHYet6Z06xOrfi30CCZTOs i3cwXc10X0kJg== Received: from localhost (unknown [84.232.140.38]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 1C14017E3818; Tue, 17 Dec 2024 22:42:37 +0100 (CET) From: Cristian Ciocaltea Date: Tue, 17 Dec 2024 23:41:51 +0200 Subject: [PATCH v5 1/3] soc: mediatek: pwrap: Switch to devm_clk_bulk_get_all_enabled() MIME-Version: 1.0 Message-Id: <20241217-clk_bulk_ena_fix-v5-1-aafbbb245155@collabora.com> References: <20241217-clk_bulk_ena_fix-v5-0-aafbbb245155@collabora.com> In-Reply-To: <20241217-clk_bulk_ena_fix-v5-0-aafbbb245155@collabora.com> To: Michael Turquette , Stephen Boyd , Russell King , Matthias Brugger , AngeloGioacchino Del Regno , Jingoo Han , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Alim Akhtar Cc: kernel@collabora.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pci@vger.kernel.org, linux-samsung-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_134238_992611_2206139B X-CRM114-Status: GOOD ( 13.51 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The helper devm_clk_bulk_get_all_enable() missed to return the number of clocks stored in the clk_bulk_data table referenced by the clks argument and, therefore, will be dropped. Use the newly introduced devm_clk_bulk_get_all_enabled() variant instead, which is consistent with devm_clk_bulk_get_all() in terms of the returned value: > 0 if one or more clocks have been stored = 0 if there are no clocks < 0 if an error occurred Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Manivannan Sadhasivam Signed-off-by: Cristian Ciocaltea Acked-by: AngeloGioacchino Del Regno --- drivers/soc/mediatek/mtk-pmic-wrap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c index 9fdc0ef79202618d0bd0188d0bf53152285c6c51..0bcd8582637550c90c1c6df619077b7df7bb0048 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -2518,8 +2518,8 @@ static int pwrap_probe(struct platform_device *pdev) } } - ret = devm_clk_bulk_get_all_enable(wrp->dev, &clk); - if (ret) + ret = devm_clk_bulk_get_all_enabled(wrp->dev, &clk); + if (ret < 0) return dev_err_probe(wrp->dev, ret, "failed to get clocks\n"); From patchwork Tue Dec 17 21:41:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 13912574 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 EDB4AE77184 for ; Tue, 17 Dec 2024 21:46: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0x1C9V5ZHpHlGFbOaJKlFFtrtiDKGs33EI3Hyb/Ln2s=; b=xfq5Eo04DyHZp6adG/0tEDMWIe x5fdy0qAu6whv+gIwuebaxhgEuTPQXgqlq9rdabY5OYfvv+OZK7/tSxbgnJlSCG+eMpgAPSbcpaGt LKnuHbRRgp2aZpvPKSP8P7xX+BCgrhCgID6p2kpFRxdytqC/bHgElk+TyKO4QwxoL0Cx3Tg+zvG2q Ce1jEGYKCJG5X7VS6G2GQZKMBiljsyMdME7Dk3R4LTDFzQamcl8CotajYnyuSpWJCPVUB9fIHlJkh ucBTxmbbDlYj5gD1ved7rpX7ELsc93UW6jJ0jPVGXrGSh7At/ZhRYW4ArpTWLx3g1lPcrlXgxLSI0 Ye6V+fxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNfOy-0000000Eufv-0stY; Tue, 17 Dec 2024 21:46:48 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNfKy-0000000Etxj-479e; Tue, 17 Dec 2024 21:42:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1734471758; bh=iEUcW5EbPc3CuJsIl+m7Y0Zgw3NQlSs/GEI0BoftKtU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lsExfrP6YrUyzNDCvIwKYIpg9WsHxjLvjhZpOyAAbvD4tN4VhCIGUHg3ymz1TR9Jp 6/5H47T+G+2dp33tm6APTLEHxu8XHiU+AP2axicvhjYpkM9OqIClsUn0gzpwlG8C3B 97BAK2L4YtfDCODe0ksfP9Xo0dbqVNIcvaFpco3EkMVo2t7OJNadd6nwEoCRufbmQ/ Y/ZxjrlsO7olnFDPoXtagd/LnTOlnQviVx0w3t0hGnD+YlCia5A6GNaNdXBcua3JbB mWPLCmctxqbYftfRp4ldrCU9NSYE80s/HHtY4SpKoMDLYMVTUXiccrxDn62pXDM1Df LHi2Iy2h1SGWQ== Received: from localhost (unknown [84.232.140.38]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 913C417E381A; Tue, 17 Dec 2024 22:42:38 +0100 (CET) From: Cristian Ciocaltea Date: Tue, 17 Dec 2024 23:41:52 +0200 Subject: [PATCH v5 2/3] PCI: exynos: Switch to devm_clk_bulk_get_all_enabled() MIME-Version: 1.0 Message-Id: <20241217-clk_bulk_ena_fix-v5-2-aafbbb245155@collabora.com> References: <20241217-clk_bulk_ena_fix-v5-0-aafbbb245155@collabora.com> In-Reply-To: <20241217-clk_bulk_ena_fix-v5-0-aafbbb245155@collabora.com> To: Michael Turquette , Stephen Boyd , Russell King , Matthias Brugger , AngeloGioacchino Del Regno , Jingoo Han , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Alim Akhtar Cc: kernel@collabora.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pci@vger.kernel.org, linux-samsung-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_134241_194941_DBA8A930 X-CRM114-Status: GOOD ( 13.09 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The helper devm_clk_bulk_get_all_enable() missed to return the number of clocks stored in the clk_bulk_data table referenced by the clks argument and, therefore, will be dropped. Use the newly introduced devm_clk_bulk_get_all_enabled() variant instead, which is consistent with devm_clk_bulk_get_all() in terms of the returned value: > 0 if one or more clocks have been stored = 0 if there are no clocks < 0 if an error occurred Reviewed-by: Manivannan Sadhasivam Signed-off-by: Cristian Ciocaltea --- drivers/pci/controller/dwc/pci-exynos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-exynos.c b/drivers/pci/controller/dwc/pci-exynos.c index 6a830166d37fff5bbbc35aaa7cc1b67b03e6ec3b..ace736b025b1b7d4cdcbd51d2e9d99af29f21149 100644 --- a/drivers/pci/controller/dwc/pci-exynos.c +++ b/drivers/pci/controller/dwc/pci-exynos.c @@ -300,7 +300,7 @@ static int exynos_pcie_probe(struct platform_device *pdev) if (IS_ERR(ep->elbi_base)) return PTR_ERR(ep->elbi_base); - ret = devm_clk_bulk_get_all_enable(dev, &ep->clks); + ret = devm_clk_bulk_get_all_enabled(dev, &ep->clks); if (ret < 0) return ret; From patchwork Tue Dec 17 21:41:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 13912575 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 E7080E77184 for ; Tue, 17 Dec 2024 21:47: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aL3MzBItx+jGyEvKKy/4vBele7OAuHh5ZkL6gMAYLEs=; b=3kJPn+kEi9fCv0VFT69jVOk0P3 dRMNgonjmwR8aQvszLVBYYDQtd28/kIaqOAOIhvsj6dDLfxeG+8r7X56hlegJ6zDQ/VvnD7/3T9ms bO8lEZlwsrsa48cTjYzVZne6D4CzatUj8z+Wf3hNg5ssjtD+VusSxr38kOELAusw7SU4VTxe97RpN x5Q8k4tlTwBJtJyHjAfLLdxM+P5jpL+iCp816Arc0G4M6wls0m1h8cGqwX3dmULFp+vimRScsMwdu EguNZcGm8WVb7ykPLsDgBOJz2cHHtYWbYBlVDZtfnnP9MDMtAW+avySeJlNlzhgC2IyxCDpeChVF4 ACzBFfsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNfQ2-0000000EupX-0YkU; Tue, 17 Dec 2024 21:47:54 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNfKz-0000000Etxp-0AqK; Tue, 17 Dec 2024 21:42:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1734471759; bh=ysF7xo/3hIsbR7jhMLjJuhC4kEcU9qe1dpoxk58hyxQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Sh6r9RnXFtGaw3exnOgkDIXkqh9usYDZUNB5KbX8Xvd4uuyIQhEZbqfJ4KK8gmTiH bWT71VNRKS0HfbkoD8GDW+B+512YfRvWXzzdBNy6hgO3MBoS4+ZcuNd+qKC6q1wJRd i/ZfZZxuUR+yZXG+5wsga0sLGgRGcuH4fxxAz6bfUoSvB2//farkEJ6ZrOdffp4zLp SS6pVMunKwIGFG28+63MArojj236eN+HZpp5MEL230Xu/sTfj89f8/Fph84eaK1WOT /1eVKvxb6WXqhmDbNQqRt+ZsEGB3F19jQMIQlCA5T+ZgdDSRHo3Aas3YA4BhXOgPf4 88W5RAI4HP6Kw== Received: from localhost (unknown [84.232.140.38]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 6027B17E381E; Tue, 17 Dec 2024 22:42:39 +0100 (CET) From: Cristian Ciocaltea Date: Tue, 17 Dec 2024 23:41:53 +0200 Subject: [PATCH v5 3/3] clk: Drop obsolete devm_clk_bulk_get_all_enable() helper MIME-Version: 1.0 Message-Id: <20241217-clk_bulk_ena_fix-v5-3-aafbbb245155@collabora.com> References: <20241217-clk_bulk_ena_fix-v5-0-aafbbb245155@collabora.com> In-Reply-To: <20241217-clk_bulk_ena_fix-v5-0-aafbbb245155@collabora.com> To: Michael Turquette , Stephen Boyd , Russell King , Matthias Brugger , AngeloGioacchino Del Regno , Jingoo Han , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Alim Akhtar Cc: kernel@collabora.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pci@vger.kernel.org, linux-samsung-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_134241_258583_3E04AE4F X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Commit 265b07df758a ("clk: Provide managed helper to get and enable bulk clocks") added devm_clk_bulk_get_all_enable() function, but missed to return the number of clocks stored in the clk_bulk_data table referenced by the clks argument. Without knowing the number, it's not possible to iterate these clocks when needed, hence the argument is useless and could have been simply removed. A new helper devm_clk_bulk_get_all_enabled() has been introduced, which is consistent with devm_clk_bulk_get_all() in terms of the returned value. Drop the obsolete function since all users switched to the new helper. Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Manivannan Sadhasivam Signed-off-by: Cristian Ciocaltea --- include/linux/clk.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/include/linux/clk.h b/include/linux/clk.h index 1dcee6d701e439f35effd86ca3ee3b47a9839bd0..b607482ca77e987b9344c38f25ebb5c8d35c1d39 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -1138,15 +1138,6 @@ static inline void clk_restore_context(void) {} #endif -/* Deprecated. Use devm_clk_bulk_get_all_enabled() */ -static inline int __must_check -devm_clk_bulk_get_all_enable(struct device *dev, struct clk_bulk_data **clks) -{ - int ret = devm_clk_bulk_get_all_enabled(dev, clks); - - return ret > 0 ? 0 : ret; -} - /* clk_prepare_enable helps cases using clk_enable in non-atomic context. */ static inline int clk_prepare_enable(struct clk *clk) {