From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Sylwester Nawrocki <s.nawrocki@samsung.com>, Tomasz Figa <tomasz.figa@gmail.com>, Chanwoo Choi <cw00.choi@samsung.com>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org> Cc: Alim Akhtar <alim.akhtar@samsung.com>, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 24/30] clk: samsung: Convert to platform remove callback returning void Date: Sun, 12 Mar 2023 17:15:06 +0100 [thread overview] Message-ID: <20230312161512.2715500-25-u.kleine-koenig@pengutronix.de> (raw) In-Reply-To: <20230312161512.2715500-1-u.kleine-koenig@pengutronix.de> The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/clk/samsung/clk-exynos-audss.c | 6 ++---- drivers/clk/samsung/clk-exynos-clkout.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c index 9cc127a162ad..7626dff41f6f 100644 --- a/drivers/clk/samsung/clk-exynos-audss.c +++ b/drivers/clk/samsung/clk-exynos-audss.c @@ -268,7 +268,7 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) return ret; } -static int exynos_audss_clk_remove(struct platform_device *pdev) +static void exynos_audss_clk_remove(struct platform_device *pdev) { of_clk_del_provider(pdev->dev.of_node); @@ -277,8 +277,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev) if (!IS_ERR(epll)) clk_disable_unprepare(epll); - - return 0; } static const struct dev_pm_ops exynos_audss_clk_pm_ops = { @@ -295,7 +293,7 @@ static struct platform_driver exynos_audss_clk_driver = { .pm = &exynos_audss_clk_pm_ops, }, .probe = exynos_audss_clk_probe, - .remove = exynos_audss_clk_remove, + .remove_new = exynos_audss_clk_remove, }; module_platform_driver(exynos_audss_clk_driver); diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c index e6d6cbf8c4e6..0cff1c94c35e 100644 --- a/drivers/clk/samsung/clk-exynos-clkout.c +++ b/drivers/clk/samsung/clk-exynos-clkout.c @@ -196,15 +196,13 @@ static int exynos_clkout_probe(struct platform_device *pdev) return ret; } -static int exynos_clkout_remove(struct platform_device *pdev) +static void exynos_clkout_remove(struct platform_device *pdev) { struct exynos_clkout *clkout = platform_get_drvdata(pdev); of_clk_del_provider(clkout->np); clk_hw_unregister(clkout->data.hws[0]); iounmap(clkout->reg); - - return 0; } static int __maybe_unused exynos_clkout_suspend(struct device *dev) @@ -235,7 +233,7 @@ static struct platform_driver exynos_clkout_driver = { .pm = &exynos_clkout_pm_ops, }, .probe = exynos_clkout_probe, - .remove = exynos_clkout_remove, + .remove_new = exynos_clkout_remove, }; module_platform_driver(exynos_clkout_driver); -- 2.39.1
WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Sylwester Nawrocki <s.nawrocki@samsung.com>, Tomasz Figa <tomasz.figa@gmail.com>, Chanwoo Choi <cw00.choi@samsung.com>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org> Cc: Alim Akhtar <alim.akhtar@samsung.com>, linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 24/30] clk: samsung: Convert to platform remove callback returning void Date: Sun, 12 Mar 2023 17:15:06 +0100 [thread overview] Message-ID: <20230312161512.2715500-25-u.kleine-koenig@pengutronix.de> (raw) In-Reply-To: <20230312161512.2715500-1-u.kleine-koenig@pengutronix.de> The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/clk/samsung/clk-exynos-audss.c | 6 ++---- drivers/clk/samsung/clk-exynos-clkout.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c index 9cc127a162ad..7626dff41f6f 100644 --- a/drivers/clk/samsung/clk-exynos-audss.c +++ b/drivers/clk/samsung/clk-exynos-audss.c @@ -268,7 +268,7 @@ static int exynos_audss_clk_probe(struct platform_device *pdev) return ret; } -static int exynos_audss_clk_remove(struct platform_device *pdev) +static void exynos_audss_clk_remove(struct platform_device *pdev) { of_clk_del_provider(pdev->dev.of_node); @@ -277,8 +277,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev) if (!IS_ERR(epll)) clk_disable_unprepare(epll); - - return 0; } static const struct dev_pm_ops exynos_audss_clk_pm_ops = { @@ -295,7 +293,7 @@ static struct platform_driver exynos_audss_clk_driver = { .pm = &exynos_audss_clk_pm_ops, }, .probe = exynos_audss_clk_probe, - .remove = exynos_audss_clk_remove, + .remove_new = exynos_audss_clk_remove, }; module_platform_driver(exynos_audss_clk_driver); diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c index e6d6cbf8c4e6..0cff1c94c35e 100644 --- a/drivers/clk/samsung/clk-exynos-clkout.c +++ b/drivers/clk/samsung/clk-exynos-clkout.c @@ -196,15 +196,13 @@ static int exynos_clkout_probe(struct platform_device *pdev) return ret; } -static int exynos_clkout_remove(struct platform_device *pdev) +static void exynos_clkout_remove(struct platform_device *pdev) { struct exynos_clkout *clkout = platform_get_drvdata(pdev); of_clk_del_provider(clkout->np); clk_hw_unregister(clkout->data.hws[0]); iounmap(clkout->reg); - - return 0; } static int __maybe_unused exynos_clkout_suspend(struct device *dev) @@ -235,7 +233,7 @@ static struct platform_driver exynos_clkout_driver = { .pm = &exynos_clkout_pm_ops, }, .probe = exynos_clkout_probe, - .remove = exynos_clkout_remove, + .remove_new = exynos_clkout_remove, }; module_platform_driver(exynos_clkout_driver); -- 2.39.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-03-12 16:17 UTC|newest] Thread overview: 96+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-03-12 16:14 [PATCH 00/30] clk: Convert to platform remove callback returning void Uwe Kleine-König 2023-03-12 16:14 ` Uwe Kleine-König 2023-03-12 16:14 ` [PATCH 01/30] clk: mediatek: Make mtk_clk_simple_remove() return void Uwe Kleine-König 2023-03-12 16:14 ` Uwe Kleine-König 2023-03-13 8:54 ` AngeloGioacchino Del Regno 2023-03-13 8:54 ` AngeloGioacchino Del Regno 2023-03-13 9:45 ` Uwe Kleine-König 2023-03-13 9:45 ` Uwe Kleine-König 2023-03-12 16:14 ` [PATCH 02/30] clk: tegra: Don't warn three times about failure to unregister Uwe Kleine-König 2023-03-29 2:34 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 03/30] clk: xilinx: Drop if block with always false condition Uwe Kleine-König 2023-03-12 16:14 ` Uwe Kleine-König 2023-03-29 2:35 ` Stephen Boyd 2023-03-29 2:35 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 04/30] clk: axs10x: Convert to platform remove callback returning void Uwe Kleine-König 2023-03-29 2:35 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 05/30] clk: bcm: " Uwe Kleine-König 2023-03-12 16:14 ` Uwe Kleine-König 2023-03-14 21:28 ` Florian Fainelli 2023-03-14 21:28 ` Florian Fainelli 2023-03-29 2:35 ` Stephen Boyd 2023-03-29 2:35 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 06/30] clk: axi-clkgen: " Uwe Kleine-König 2023-03-29 2:36 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 07/30] clk: axm5516: " Uwe Kleine-König 2023-03-29 2:36 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 08/30] clk: fixed-factor: " Uwe Kleine-König 2023-03-29 2:36 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 09/30] clk: fixed-mmio: " Uwe Kleine-König 2023-03-29 2:36 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 10/30] clk: fixed-rate: " Uwe Kleine-König 2023-03-29 2:37 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 11/30] clk: hsdk-pll: " Uwe Kleine-König 2023-03-29 2:37 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 12/30] clk: palmas: " Uwe Kleine-König 2023-03-29 2:37 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 13/30] clk: pwm: " Uwe Kleine-König 2023-03-29 2:37 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 14/30] clk: s2mps11: " Uwe Kleine-König 2023-03-12 16:22 ` Krzysztof Kozlowski 2023-03-29 2:37 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 15/30] clk: scpi: " Uwe Kleine-König 2023-03-12 16:14 ` Uwe Kleine-König 2023-03-16 15:01 ` Sudeep Holla 2023-03-16 15:01 ` Sudeep Holla 2023-03-16 15:48 ` Uwe Kleine-König 2023-03-16 15:48 ` Uwe Kleine-König 2023-03-17 0:31 ` Stephen Boyd 2023-03-17 0:31 ` Stephen Boyd 2023-03-29 2:38 ` Stephen Boyd 2023-03-29 2:38 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 16/30] clk: stm32mp1: " Uwe Kleine-König 2023-03-12 16:14 ` Uwe Kleine-König 2023-03-29 2:38 ` Stephen Boyd 2023-03-29 2:38 ` Stephen Boyd 2023-03-12 16:14 ` [PATCH 17/30] clk: hisilicon: " Uwe Kleine-König 2023-03-29 2:38 ` Stephen Boyd 2023-03-12 16:15 ` [PATCH 18/30] clk: keystone: " Uwe Kleine-König 2023-03-12 16:15 ` Uwe Kleine-König 2023-03-29 2:39 ` Stephen Boyd 2023-03-29 2:39 ` Stephen Boyd 2023-03-12 16:15 ` [PATCH 19/30] clk: mediatek: " Uwe Kleine-König 2023-03-12 16:15 ` Uwe Kleine-König 2023-03-29 2:39 ` Stephen Boyd 2023-03-29 2:39 ` Stephen Boyd 2023-03-12 16:15 ` [PATCH 20/30] clk: mmp: " Uwe Kleine-König 2023-03-29 2:39 ` Stephen Boyd 2023-03-12 16:15 ` [PATCH 21/30] clk: mvebu: " Uwe Kleine-König 2023-03-29 2:39 ` Stephen Boyd 2023-03-12 16:15 ` [PATCH 22/30] clk: qcom: " Uwe Kleine-König 2023-03-12 16:15 ` [PATCH 23/30] clk: renesas: " Uwe Kleine-König 2023-03-13 9:05 ` Geert Uytterhoeven 2023-03-12 16:15 ` Uwe Kleine-König [this message] 2023-03-12 16:15 ` [PATCH 24/30] clk: samsung: " Uwe Kleine-König 2023-03-12 16:33 ` (subset) " Krzysztof Kozlowski 2023-03-12 16:33 ` Krzysztof Kozlowski 2023-03-12 16:15 ` [PATCH 25/30] clk: stm32: " Uwe Kleine-König 2023-03-12 16:15 ` Uwe Kleine-König 2023-03-29 2:40 ` Stephen Boyd 2023-03-29 2:40 ` Stephen Boyd 2023-03-12 16:15 ` [PATCH 26/30] clk: tegra: " Uwe Kleine-König 2023-03-29 2:40 ` Stephen Boyd 2023-03-12 16:15 ` [PATCH 27/30] clk: ti: " Uwe Kleine-König 2023-03-29 2:40 ` Stephen Boyd 2023-03-12 16:15 ` [PATCH 28/30] clk: uniphier: " Uwe Kleine-König 2023-03-12 16:15 ` Uwe Kleine-König 2023-03-29 2:40 ` Stephen Boyd 2023-03-29 2:40 ` Stephen Boyd 2023-03-12 16:15 ` [PATCH 29/30] clk: x86: " Uwe Kleine-König 2023-03-29 2:40 ` Stephen Boyd 2023-03-12 16:15 ` [PATCH 30/30] clk: xilinx: " Uwe Kleine-König 2023-03-12 16:15 ` Uwe Kleine-König 2023-03-29 2:41 ` Stephen Boyd 2023-03-29 2:41 ` Stephen Boyd 2023-03-15 23:35 ` (subset) [PATCH 00/30] clk: " Bjorn Andersson 2023-03-15 23:35 ` Bjorn Andersson
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230312161512.2715500-25-u.kleine-koenig@pengutronix.de \ --to=u.kleine-koenig@pengutronix.de \ --cc=alim.akhtar@samsung.com \ --cc=cw00.choi@samsung.com \ --cc=krzysztof.kozlowski@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-clk@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=mturquette@baylibre.com \ --cc=s.nawrocki@samsung.com \ --cc=sboyd@kernel.org \ --cc=tomasz.figa@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.