From patchwork Tue Dec 12 17:26:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13489723 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABE278E for ; Tue, 12 Dec 2023 09:27:05 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rD6X0-0001uN-S6; Tue, 12 Dec 2023 18:26:54 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rD6Ww-00FOPG-CS; Tue, 12 Dec 2023 18:26:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rD6Ww-001nbZ-3C; Tue, 12 Dec 2023 18:26:50 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Michael Turquette , Stephen Boyd , Russell King Cc: linux-clk@vger.kernel.org, MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 1/5] PM / devfreq: sun8i-a33-mbus: Simplify usage of clk_rate_exclusive_get() Date: Tue, 12 Dec 2023 18:26:38 +0100 Message-ID: <5ef585a3d7bee42bac5be0e40efcfbc6e75adfff.1702400947.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1602; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=BWEEMlbdk3cKjZWyjUvI7IytAUTTT/WV9gCP1GmZcvI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBleJfOPmhzoDA5sG4qdhrM/sUvX0qCREHgSRiU7 27S9foq6kCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXiXzgAKCRCPgPtYfRL+ Thb/B/4w7Bw3FZfecp+Y/PyOwb2XfViWXvM2i2f8tgwva1QajIak9kWuF0ZP1djzjPmArx0WOgi YUd/05PoXflA6sbaolfQrr4uKIRiukF7cs3ohwBjLwCfdVM8FroeP9KIXAcvi3qyX783jicwxzz fLisYqpkTtYsnKPzHhLumHKKIMV4fmWgYpWm9cE8bIVn//IUWOwN5Of3ighdH0PZqg4CKWEuNSW APNEhWEhPIc1XPW5xsBB1SSTPRTRAlVvyFjO1JEO8LIYr1azhNzgV1YWEeWY9A0JKQXaYwNW8Sl 9L6/ctC/RrM5mOka4woknUF4DKZbyZ3GNUf/9rwQwdyWwYUv X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-clk@vger.kernel.org clk_rate_exclusive_get() returns 0 unconditionally. So remove error handling. This prepares making clk_rate_exclusive_get() return void. Signed-off-by: Uwe Kleine-König Reviewed-by: Andre Przywara --- drivers/devfreq/sun8i-a33-mbus.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/devfreq/sun8i-a33-mbus.c b/drivers/devfreq/sun8i-a33-mbus.c index 13d32213139f..bbc577556944 100644 --- a/drivers/devfreq/sun8i-a33-mbus.c +++ b/drivers/devfreq/sun8i-a33-mbus.c @@ -381,18 +381,10 @@ static int sun8i_a33_mbus_probe(struct platform_device *pdev) "failed to enable bus clock\n"); /* Lock the DRAM clock rate to keep priv->nominal_bw in sync. */ - ret = clk_rate_exclusive_get(priv->clk_dram); - if (ret) { - err = "failed to lock dram clock rate\n"; - goto err_disable_bus; - } + clk_rate_exclusive_get(priv->clk_dram); /* Lock the MBUS clock rate to keep MBUS_TMR_PERIOD in sync. */ - ret = clk_rate_exclusive_get(priv->clk_mbus); - if (ret) { - err = "failed to lock mbus clock rate\n"; - goto err_unlock_dram; - } + clk_rate_exclusive_get(priv->clk_mbus); priv->gov_data.upthreshold = 10; priv->gov_data.downdifferential = 5; @@ -450,9 +442,7 @@ static int sun8i_a33_mbus_probe(struct platform_device *pdev) dev_pm_opp_remove_all_dynamic(dev); err_unlock_mbus: clk_rate_exclusive_put(priv->clk_mbus); -err_unlock_dram: clk_rate_exclusive_put(priv->clk_dram); -err_disable_bus: clk_disable_unprepare(priv->clk_bus); return dev_err_probe(dev, ret, err); From patchwork Tue Dec 12 17:26:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13489720 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5173FE3 for ; Tue, 12 Dec 2023 09:26:53 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rD6Wx-0001uO-KM; Tue, 12 Dec 2023 18:26:51 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rD6Ww-00FOPJ-Ja; Tue, 12 Dec 2023 18:26:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rD6Ww-001nbc-AC; Tue, 12 Dec 2023 18:26:50 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Michael Turquette , Stephen Boyd , Russell King Cc: linux-clk@vger.kernel.org, Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 2/5] drm/meson: Simplify usage of clk_rate_exclusive_get() Date: Tue, 12 Dec 2023 18:26:39 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1307; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=lLn3GpEtn8Cldb1t/gKKd7hxYx+CsmdNoorQTl0ii64=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBleJfPh1ko5EuKFkzhis18D1Q6ufxw2cmlRezUb e1bX4MJFxWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXiXzwAKCRCPgPtYfRL+ TuuXCACFYHK5vepI6H1w3vCAtGF3mzbvZvEHD9O6QgdN21YNyyRm5kW1ZmKRVDiiOabTVbvn6i/ r39UlcJB9fpR9+HopiUwEA+e8cmJF/6TfvG29AVvfxpEVBVhrXHQJo6JB6n9Z7ccemj7jxMIMit x/3W3JwISr2aymfEcfTrFnnxdK9bAnqa0w2zs+NcKeIGn4CX8sQzvf2FjdUTFHHvBXjBOns7g+C UHEn7VB/4ZkwXr9AbvUSPgxMkgDDm+JDoabKjzRVViZ0D2F0FmFBjDRHKlUgtSXA1J8bZ0fVtGM 5pVKd7TqH5FT6GXCnpqsgghJkyVfCpitvxCNhlgib/X06l7P X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-clk@vger.kernel.org clk_rate_exclusive_get() returns 0 unconditionally. So remove error handling. This prepares making clk_rate_exclusive_get() return void. Signed-off-by: Uwe Kleine-König --- Hello, btw, the driver fails to call clk_rate_exclusive_put() in the error paths of dw_mipi_dsi_phy_init(). Best regards Uwe drivers/gpu/drm/meson/meson_dw_mipi_dsi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c index a6bc1bdb3d0d..49571f1ed88a 100644 --- a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c +++ b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c @@ -88,15 +88,9 @@ static int dw_mipi_dsi_phy_init(void *priv_data) } /* Make sure the rate of the bit clock is not modified by someone else */ - ret = clk_rate_exclusive_get(mipi_dsi->bit_clk); - if (ret) { - dev_err(mipi_dsi->dev, - "Failed to set the exclusivity on the bit clock rate (ret %d)\n", ret); - return ret; - } + clk_rate_exclusive_get(mipi_dsi->bit_clk); ret = clk_set_rate(mipi_dsi->px_clk, mipi_dsi->mode->clock * 1000); - if (ret) { dev_err(mipi_dsi->dev, "Failed to set DSI Pixel clock rate %u (%d)\n", mipi_dsi->mode->clock * 1000, ret); From patchwork Tue Dec 12 17:26:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13489721 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E9C5A1 for ; Tue, 12 Dec 2023 09:27:00 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rD6Wx-0001uP-MN; Tue, 12 Dec 2023 18:26:51 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rD6Ww-00FOPM-QL; Tue, 12 Dec 2023 18:26:50 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rD6Ww-001nbh-H3; Tue, 12 Dec 2023 18:26:50 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Michael Turquette , Stephen Boyd , Russell King Cc: linux-clk@vger.kernel.org, Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Rob Herring , linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 3/5] memory: tegra210-emc: Simplify usage of clk_rate_exclusive_get() Date: Tue, 12 Dec 2023 18:26:40 +0100 Message-ID: <1b4321a975ac1a903a0c816ef2cce80e7d75eae3.1702400947.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=956; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=ie4CKnPihpbljeuxgdDQACHBuHzPJFsgaUm9SE/yLlM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBleJfQjouCGPQwbVTQpZHCH3+mc5P4eZ8kxEPs7 4nUI3a0K5aJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXiX0AAKCRCPgPtYfRL+ TrPSCACJPDSfzHiFme8LNMO5WXJD8MYT1blleR5sU2wv13himlwKpRz181lEcgpDPwv/d7r/nBn ovlNOR/cPdj22iF2Np1psWwvsUfXhnOijVNvyUuyZgsqjUW8TVMBoqg+yxKPfy1Ci+Xd6Em/Xl9 MsSz5I6yQHlYt79kc9K+UoSimvBDW7R8bFM91X+Fzb3PCkCVDDG8jKeAAORmcuILHZdB5+nRmpB AQAfTK3wpi13Fwr54EQ83CvVNencH39m0Y68owZMIH97xru6ER+rWbaNlR/yq6BgTqIY+S8REsv eH/xD+T8INlM+XNf0qnAttCf1OAC4WgQh9IiGZ7cSabVpWXK X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-clk@vger.kernel.org clk_rate_exclusive_get() returns 0 unconditionally. So remove error handling. This prepares making clk_rate_exclusive_get() return void. Signed-off-by: Uwe Kleine-König Acked-by: Krzysztof Kozlowski --- drivers/memory/tegra/tegra210-emc-core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/memory/tegra/tegra210-emc-core.c b/drivers/memory/tegra/tegra210-emc-core.c index 3300bde47c13..957bcaadb24f 100644 --- a/drivers/memory/tegra/tegra210-emc-core.c +++ b/drivers/memory/tegra/tegra210-emc-core.c @@ -2001,11 +2001,7 @@ static int __maybe_unused tegra210_emc_suspend(struct device *dev) struct tegra210_emc *emc = dev_get_drvdata(dev); int err; - err = clk_rate_exclusive_get(emc->clk); - if (err < 0) { - dev_err(emc->dev, "failed to acquire clock: %d\n", err); - return err; - } + clk_rate_exclusive_get(emc->clk); emc->resume_rate = clk_get_rate(emc->clk); From patchwork Tue Dec 12 17:26:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13489722 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57CC68E for ; Tue, 12 Dec 2023 09:27:02 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rD6Wx-0001uQ-MT; Tue, 12 Dec 2023 18:26:51 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rD6Wx-00FOPP-2e; Tue, 12 Dec 2023 18:26:51 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rD6Ww-001nbl-Pg; Tue, 12 Dec 2023 18:26:50 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Michael Turquette , Stephen Boyd , Russell King Cc: linux-clk@vger.kernel.org, Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Johan Hovold , Georgi Djakov , Rob Herring , linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 4/5] memory: tegra30-emc: Simplify usage of clk_rate_exclusive_get() Date: Tue, 12 Dec 2023 18:26:41 +0100 Message-ID: <9cf2553c9da167ebf6654bbdeab6ce2a93232ca6.1702400947.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=966; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=/SRuKBC39buZsWlbWBv7+96SVuuaEgkac/QXVMO5G6c=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBleJfRwIcGicrAotiVL8mlo7dbUTNw3bWwZk8En opEt170hFKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZXiX0QAKCRCPgPtYfRL+ TqCpCACiWCRhk+aAoozmvgJ1Fw+AsM0K4IA40aYwhkcIVdOH+ZZr84wat/ZtWuz5N+N3UFDmh/v iv1DF/WcewcwjYR4ml3iPgZEjM/We8quWlW0OPJSrsEnZcuh22Ot+V3AImmznPqfCnshummKZ2N plgA7zAtRsya5pZslCR086URGOednrRkNlYwjQj4FoFKR0fxtYE6aLdhDIWVtpZcNnHUVtTQRCg B12RA83tuk3xnBhW8NVxTE47uzUWgTIx0YmzNeCxGnif5JjBeV1aHncvjazdZUxseJntAdsbNS8 g2J3QHQGroWs7MItRSE9ow/JkUbKgaqy5DXxOsDAsDn2PBvt X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-clk@vger.kernel.org clk_rate_exclusive_get() returns 0 unconditionally. So remove error handling. This prepares making clk_rate_exclusive_get() return void. Signed-off-by: Uwe Kleine-König Acked-by: Krzysztof Kozlowski --- drivers/memory/tegra/tegra30-emc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c index 9eae25c57ec6..496b42c4c1a8 100644 --- a/drivers/memory/tegra/tegra30-emc.c +++ b/drivers/memory/tegra/tegra30-emc.c @@ -1696,11 +1696,7 @@ static int tegra_emc_suspend(struct device *dev) int err; /* take exclusive control over the clock's rate */ - err = clk_rate_exclusive_get(emc->clk); - if (err) { - dev_err(emc->dev, "failed to acquire clk: %d\n", err); - return err; - } + clk_rate_exclusive_get(emc->clk); /* suspending in a bad state will hang machine */ if (WARN(emc->bad_state, "hardware in a bad state\n")) From patchwork Tue Dec 12 17:26:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13489724 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43A158F for ; Tue, 12 Dec 2023 09:27:19 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rD6X1-0001uR-3P; Tue, 12 Dec 2023 18:26:55 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rD6Wx-00FOPS-AU; Tue, 12 Dec 2023 18:26:51 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rD6Wx-001nbp-0U; Tue, 12 Dec 2023 18:26:51 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Michael Turquette , Stephen Boyd , Russell King Cc: linux-clk@vger.kernel.org, MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Rob Herring , linux-tegra@vger.kernel.org, Johan Hovold , Georgi Djakov , kernel@pengutronix.de Subject: [PATCH 5/5] clk: Make clk_rate_exclusive_get() return void Date: Tue, 12 Dec 2023 18:26:42 +0100 Message-ID: <3f556647c09162be61edba6b50e76d235aace590.1702400947.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2265; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=qJe1s9wVwLl8m/pFpVrdi1+PKSyFn6KyEhyiKlqeWWk=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtSK6Zf0mliZ79remRRaoTdVj3sjX5Z43dTfXEr7MubN7 cv5Yz2jk9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJuD3nYNgg+PrYSkuD2Eki L1U4HRwVOm/VLGkPWWUoV1WYwxBfEWYmlb5vdk5eXETUxLjPjnuM9m124lwrkvHnX3X3TrfzUWd XtRVfrdwx53zY0iitL8q7iiOm/RSY41yVxy7Q3SF+Yf3DO/PK2hbZC6n2+hisPicuvTMhrsv85J +QOu6/GZ3CmxdfOB8buHp9dNSn+ZszIi1YT3amxbtM0I1SV/vT2/G2XCwjeaJz5bNzS+UOnBYu3 8VyICqoSHNi9dnMPxmiJx7qHy3ZySo1tTiDY5NraL5Po03Y7PjDOWnuQoe36p20d9SY6BYbPV8/ xLjJxNLi0Z73rq0//xkv+LSD59R1XatNPzx3tk47vXM3AA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-clk@vger.kernel.org The function currently returns 0 unconditionally. This isn't very useful and makes users create dead code error paths. So let this function return no value. All users were adapted before to ignore the returned value. Also fix a few typos in the kernel doc comment for clk_rate_exclusive_get(). Signed-off-by: Uwe Kleine-König --- drivers/clk/clk.c | 6 ++---- include/linux/clk.h | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 2253c154a824..af2011c2a93b 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -925,17 +925,15 @@ static void clk_core_rate_restore_protect(struct clk_core *core, int count) * clk_rate_exclusive_put(). Calls to this function may sleep. * Returns 0 on success, -EERROR otherwise */ -int clk_rate_exclusive_get(struct clk *clk) +void clk_rate_exclusive_get(struct clk *clk) { if (!clk) - return 0; + return; clk_prepare_lock(); clk_core_rate_protect(clk->core); clk->exclusive_count++; clk_prepare_unlock(); - - return 0; } EXPORT_SYMBOL_GPL(clk_rate_exclusive_get); diff --git a/include/linux/clk.h b/include/linux/clk.h index 06f1b292f8a0..f88c407925f8 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -190,16 +190,14 @@ bool clk_is_match(const struct clk *p, const struct clk *q); * * This function allows drivers to get exclusive control over the rate of a * provider. It prevents any other consumer to execute, even indirectly, - * opereation which could alter the rate of the provider or cause glitches + * operation which could alter the rate of the provider or cause glitches * - * If exlusivity is claimed more than once on clock, even by the same driver, + * If exclusivity is claimed more than once on clock, even by the same driver, * the rate effectively gets locked as exclusivity can't be preempted. * * Must not be called from within atomic context. - * - * Returns success (0) or negative errno. */ -int clk_rate_exclusive_get(struct clk *clk); +void clk_rate_exclusive_get(struct clk *clk); /** * clk_rate_exclusive_put - release exclusivity over the rate control of a