linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/30] clk: Convert to platform remove callback returning void
@ 2023-03-12 16:14 Uwe Kleine-König
  2023-03-12 16:14 ` [PATCH 14/30] clk: s2mps11: " Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2023-03-12 16:14 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger,
	Peter De Schrijver, Prashant Gaikwad, Thierry Reding,
	Jonathan Hunter, Michal Simek, Eugeniy Paltsev, Florian Fainelli,
	Krzysztof Kozlowski, Sudeep Holla, Maxime Coquelin,
	Alexandre Torgue, Nishanth Menon, Tero Kristo, Santosh Shilimkar,
	Bjorn Andersson, Andy Gross, Geert Uytterhoeven,
	Sylwester Nawrocki, Tomasz Figa, Chanwoo Choi, Kunihiko Hayashi,
	Masami Hiramatsu
  Cc: AngeloGioacchino Del Regno, linux-clk, linux-kernel,
	linux-arm-kernel, linux-mediatek, linux-tegra,
	Broadcom internal kernel review list, linux-rpi-kernel,
	linux-samsung-soc, Cristian Marussi, linux-stm32, Konrad Dybcio,
	linux-arm-msm, linux-renesas-soc, Alim Akhtar, linux-omap

Hello,

this patch series adapts the platform drivers below drivers/clk
to use the .remove_new() callback. Compared to the traditional .remove()
callback .remove_new() returns no value. This is a good thing because
the driver core doesn't (and cannot) cope for errors during remove. The
only effect of a non-zero return value in .remove() is that the driver
core emits a warning. The device is removed anyhow and an early return
from .remove() usually yields a resource leak.

There were three drivers that did such an early error return in their
remove callback. Two of them are fixed, the tegra one is more
complicated. I only converted it to return zero (which only suppresses
the duplicated warning by the driver core, but doesn't make the resource
leak better or worse.) This needs some more attention by someone who
understands the driver in question.

By changing the remove callback to return void driver authors cannot
reasonably assume any more that there is some kind of cleanup later
which prevents that such programming errors are introduced in the first
place.

Note that this series depends on commit 5c5a7680e67b ("platform: Provide
a remove callback that returns no value") which is included in v6.3-rc1.

Uwe Kleine-König (30):
  clk: mediatek: Make mtk_clk_simple_remove() return void
  clk: tegra: Don't warn three times about failure to unregister
  clk: xilinx: Drop if block with always false condition
  clk: axs10x: Convert to platform remove callback returning void
  clk: bcm: Convert to platform remove callback returning void
  clk: axi-clkgen: Convert to platform remove callback returning void
  clk: axm5516: Convert to platform remove callback returning void
  clk: fixed-factor: Convert to platform remove callback returning void
  clk: fixed-mmio: Convert to platform remove callback returning void
  clk: fixed-rate: Convert to platform remove callback returning void
  clk: hsdk-pll: Convert to platform remove callback returning void
  clk: palmas: Convert to platform remove callback returning void
  clk: pwm: Convert to platform remove callback returning void
  clk: s2mps11: Convert to platform remove callback returning void
  clk: scpi: Convert to platform remove callback returning void
  clk: stm32mp1: Convert to platform remove callback returning void
  clk: hisilicon: Convert to platform remove callback returning void
  clk: keystone: Convert to platform remove callback returning void
  clk: mediatek: Convert to platform remove callback returning void
  clk: mmp: Convert to platform remove callback returning void
  clk: mvebu: Convert to platform remove callback returning void
  clk: qcom: Convert to platform remove callback returning void
  clk: renesas: Convert to platform remove callback returning void
  clk: samsung: Convert to platform remove callback returning void
  clk: stm32: Convert to platform remove callback returning void
  clk: tegra: Convert to platform remove callback returning void
  clk: ti: Convert to platform remove callback returning void
  clk: uniphier: Convert to platform remove callback returning void
  clk: x86: Convert to platform remove callback returning void
  clk: xilinx: Convert to platform remove callback returning void

 drivers/clk/axs10x/i2s_pll_clock.c             |  5 ++---
 drivers/clk/axs10x/pll_clock.c                 |  5 ++---
 drivers/clk/bcm/clk-bcm2711-dvp.c              |  6 ++----
 drivers/clk/bcm/clk-bcm63xx-gate.c             |  6 ++----
 drivers/clk/bcm/clk-raspberrypi.c              |  6 ++----
 drivers/clk/clk-axi-clkgen.c                   |  6 ++----
 drivers/clk/clk-axm5516.c                      |  5 ++---
 drivers/clk/clk-fixed-factor.c                 |  6 ++----
 drivers/clk/clk-fixed-mmio.c                   |  6 ++----
 drivers/clk/clk-fixed-rate.c                   |  6 ++----
 drivers/clk/clk-hsdk-pll.c                     |  5 ++---
 drivers/clk/clk-palmas.c                       |  5 ++---
 drivers/clk/clk-pwm.c                          |  6 ++----
 drivers/clk/clk-s2mps11.c                      |  6 ++----
 drivers/clk/clk-scpi.c                         |  5 ++---
 drivers/clk/clk-stm32mp1.c                     |  6 ++----
 drivers/clk/hisilicon/clk-hi3519.c             |  5 ++---
 drivers/clk/hisilicon/clk-hi3559a.c            |  5 ++---
 drivers/clk/hisilicon/crg-hi3516cv300.c        |  5 ++---
 drivers/clk/hisilicon/crg-hi3798cv200.c        |  5 ++---
 drivers/clk/keystone/sci-clk.c                 |  6 ++----
 drivers/clk/mediatek/clk-mt2701-aud.c          |  6 +++---
 drivers/clk/mediatek/clk-mt2701-bdp.c          |  2 +-
 drivers/clk/mediatek/clk-mt2701-eth.c          |  2 +-
 drivers/clk/mediatek/clk-mt2701-g3d.c          |  2 +-
 drivers/clk/mediatek/clk-mt2701-hif.c          |  2 +-
 drivers/clk/mediatek/clk-mt2701-img.c          |  2 +-
 drivers/clk/mediatek/clk-mt2701-vdec.c         |  2 +-
 drivers/clk/mediatek/clk-mt2712-bdp.c          |  2 +-
 drivers/clk/mediatek/clk-mt2712-img.c          |  2 +-
 drivers/clk/mediatek/clk-mt2712-jpgdec.c       |  2 +-
 drivers/clk/mediatek/clk-mt2712-mfg.c          |  2 +-
 drivers/clk/mediatek/clk-mt2712-vdec.c         |  2 +-
 drivers/clk/mediatek/clk-mt2712-venc.c         |  2 +-
 drivers/clk/mediatek/clk-mt2712.c              |  2 +-
 drivers/clk/mediatek/clk-mt6765-audio.c        |  2 +-
 drivers/clk/mediatek/clk-mt6765-cam.c          |  2 +-
 drivers/clk/mediatek/clk-mt6765-img.c          |  2 +-
 drivers/clk/mediatek/clk-mt6765-mipi0a.c       |  2 +-
 drivers/clk/mediatek/clk-mt6765-mm.c           |  2 +-
 drivers/clk/mediatek/clk-mt6765-vcodec.c       |  2 +-
 drivers/clk/mediatek/clk-mt6779-aud.c          |  2 +-
 drivers/clk/mediatek/clk-mt6779-cam.c          |  2 +-
 drivers/clk/mediatek/clk-mt6779-img.c          |  2 +-
 drivers/clk/mediatek/clk-mt6779-ipe.c          |  2 +-
 drivers/clk/mediatek/clk-mt6779-mfg.c          |  2 +-
 drivers/clk/mediatek/clk-mt6779-vdec.c         |  2 +-
 drivers/clk/mediatek/clk-mt6779-venc.c         |  2 +-
 drivers/clk/mediatek/clk-mt6779.c              |  2 +-
 drivers/clk/mediatek/clk-mt6795-apmixedsys.c   |  6 ++----
 drivers/clk/mediatek/clk-mt6795-infracfg.c     |  6 ++----
 drivers/clk/mediatek/clk-mt6795-mfg.c          |  2 +-
 drivers/clk/mediatek/clk-mt6795-mm.c           |  6 ++----
 drivers/clk/mediatek/clk-mt6795-pericfg.c      |  6 ++----
 drivers/clk/mediatek/clk-mt6795-topckgen.c     |  2 +-
 drivers/clk/mediatek/clk-mt6795-vdecsys.c      |  2 +-
 drivers/clk/mediatek/clk-mt6795-vencsys.c      |  2 +-
 drivers/clk/mediatek/clk-mt6797-img.c          |  2 +-
 drivers/clk/mediatek/clk-mt6797-vdec.c         |  2 +-
 drivers/clk/mediatek/clk-mt6797-venc.c         |  2 +-
 drivers/clk/mediatek/clk-mt7622-aud.c          |  6 +++---
 drivers/clk/mediatek/clk-mt7622-eth.c          |  2 +-
 drivers/clk/mediatek/clk-mt7622-hif.c          |  2 +-
 drivers/clk/mediatek/clk-mt7629-hif.c          |  2 +-
 drivers/clk/mediatek/clk-mt7981-eth.c          |  2 +-
 drivers/clk/mediatek/clk-mt7981-infracfg.c     |  2 +-
 drivers/clk/mediatek/clk-mt7981-topckgen.c     |  2 +-
 drivers/clk/mediatek/clk-mt7986-topckgen.c     |  2 +-
 drivers/clk/mediatek/clk-mt8173-apmixedsys.c   |  6 ++----
 drivers/clk/mediatek/clk-mt8173-img.c          |  2 +-
 drivers/clk/mediatek/clk-mt8173-infracfg.c     |  6 ++----
 drivers/clk/mediatek/clk-mt8173-mm.c           |  6 ++----
 drivers/clk/mediatek/clk-mt8173-pericfg.c      |  2 +-
 drivers/clk/mediatek/clk-mt8173-topckgen.c     |  2 +-
 drivers/clk/mediatek/clk-mt8173-vdecsys.c      |  2 +-
 drivers/clk/mediatek/clk-mt8173-vencsys.c      |  2 +-
 drivers/clk/mediatek/clk-mt8183-audio.c        |  6 +++---
 drivers/clk/mediatek/clk-mt8183-cam.c          |  2 +-
 drivers/clk/mediatek/clk-mt8183-img.c          |  2 +-
 drivers/clk/mediatek/clk-mt8183-ipu0.c         |  2 +-
 drivers/clk/mediatek/clk-mt8183-ipu1.c         |  2 +-
 drivers/clk/mediatek/clk-mt8183-ipu_adl.c      |  2 +-
 drivers/clk/mediatek/clk-mt8183-ipu_conn.c     |  2 +-
 drivers/clk/mediatek/clk-mt8183-mfgcfg.c       |  2 +-
 drivers/clk/mediatek/clk-mt8183-vdec.c         |  2 +-
 drivers/clk/mediatek/clk-mt8183-venc.c         |  2 +-
 drivers/clk/mediatek/clk-mt8183.c              |  2 +-
 drivers/clk/mediatek/clk-mt8186-apmixedsys.c   |  6 ++----
 drivers/clk/mediatek/clk-mt8186-cam.c          |  2 +-
 drivers/clk/mediatek/clk-mt8186-img.c          |  2 +-
 drivers/clk/mediatek/clk-mt8186-imp_iic_wrap.c |  2 +-
 drivers/clk/mediatek/clk-mt8186-infra_ao.c     |  2 +-
 drivers/clk/mediatek/clk-mt8186-ipe.c          |  2 +-
 drivers/clk/mediatek/clk-mt8186-mcu.c          |  6 ++----
 drivers/clk/mediatek/clk-mt8186-mdp.c          |  2 +-
 drivers/clk/mediatek/clk-mt8186-mfg.c          |  2 +-
 drivers/clk/mediatek/clk-mt8186-mm.c           |  6 ++----
 drivers/clk/mediatek/clk-mt8186-topckgen.c     |  2 +-
 drivers/clk/mediatek/clk-mt8186-vdec.c         |  2 +-
 drivers/clk/mediatek/clk-mt8186-venc.c         |  2 +-
 drivers/clk/mediatek/clk-mt8186-wpe.c          |  2 +-
 drivers/clk/mediatek/clk-mt8192-aud.c          |  6 +++---
 drivers/clk/mediatek/clk-mt8192-cam.c          |  2 +-
 drivers/clk/mediatek/clk-mt8192-img.c          |  2 +-
 drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c |  2 +-
 drivers/clk/mediatek/clk-mt8192-ipe.c          |  2 +-
 drivers/clk/mediatek/clk-mt8192-mdp.c          |  2 +-
 drivers/clk/mediatek/clk-mt8192-mfg.c          |  2 +-
 drivers/clk/mediatek/clk-mt8192-msdc.c         |  2 +-
 drivers/clk/mediatek/clk-mt8192-scp_adsp.c     |  2 +-
 drivers/clk/mediatek/clk-mt8192-vdec.c         |  2 +-
 drivers/clk/mediatek/clk-mt8192-venc.c         |  2 +-
 drivers/clk/mediatek/clk-mt8192.c              |  2 +-
 drivers/clk/mediatek/clk-mt8195-apmixedsys.c   |  6 ++----
 drivers/clk/mediatek/clk-mt8195-apusys_pll.c   |  6 ++----
 drivers/clk/mediatek/clk-mt8195-cam.c          |  2 +-
 drivers/clk/mediatek/clk-mt8195-ccu.c          |  2 +-
 drivers/clk/mediatek/clk-mt8195-img.c          |  2 +-
 drivers/clk/mediatek/clk-mt8195-imp_iic_wrap.c |  2 +-
 drivers/clk/mediatek/clk-mt8195-infra_ao.c     |  2 +-
 drivers/clk/mediatek/clk-mt8195-ipe.c          |  2 +-
 drivers/clk/mediatek/clk-mt8195-mfg.c          |  2 +-
 drivers/clk/mediatek/clk-mt8195-peri_ao.c      |  2 +-
 drivers/clk/mediatek/clk-mt8195-scp_adsp.c     |  2 +-
 drivers/clk/mediatek/clk-mt8195-topckgen.c     |  6 ++----
 drivers/clk/mediatek/clk-mt8195-vdec.c         |  2 +-
 drivers/clk/mediatek/clk-mt8195-vdo0.c         |  6 ++----
 drivers/clk/mediatek/clk-mt8195-vdo1.c         |  6 ++----
 drivers/clk/mediatek/clk-mt8195-venc.c         |  2 +-
 drivers/clk/mediatek/clk-mt8195-vpp0.c         |  6 ++----
 drivers/clk/mediatek/clk-mt8195-vpp1.c         |  6 ++----
 drivers/clk/mediatek/clk-mt8195-wpe.c          |  2 +-
 drivers/clk/mediatek/clk-mt8365-apu.c          |  2 +-
 drivers/clk/mediatek/clk-mt8365-cam.c          |  2 +-
 drivers/clk/mediatek/clk-mt8365-mfg.c          |  2 +-
 drivers/clk/mediatek/clk-mt8365-vdec.c         |  2 +-
 drivers/clk/mediatek/clk-mt8365-venc.c         |  2 +-
 drivers/clk/mediatek/clk-mtk.c                 |  4 +---
 drivers/clk/mediatek/clk-mtk.h                 |  2 +-
 drivers/clk/mmp/clk-audio.c                    |  6 ++----
 drivers/clk/mvebu/armada-37xx-periph.c         |  6 ++----
 drivers/clk/mvebu/armada-37xx-tbg.c            |  6 ++----
 drivers/clk/mvebu/armada-37xx-xtal.c           |  6 ++----
 drivers/clk/qcom/apcs-msm8916.c                |  6 ++----
 drivers/clk/qcom/apcs-sdx55.c                  |  6 ++----
 drivers/clk/qcom/clk-rpm.c                     |  5 ++---
 drivers/clk/qcom/gcc-msm8960.c                 |  6 ++----
 drivers/clk/renesas/rcar-usb2-clock-sel.c      |  6 ++----
 drivers/clk/samsung/clk-exynos-audss.c         |  6 ++----
 drivers/clk/samsung/clk-exynos-clkout.c        |  6 ++----
 drivers/clk/stm32/clk-stm32mp13.c              |  6 ++----
 drivers/clk/tegra/clk-dfll.c                   |  5 ++++-
 drivers/clk/tegra/clk-tegra124-dfll-fcpu.c     | 17 ++++++++---------
 drivers/clk/ti/adpll.c                         |  6 ++----
 drivers/clk/uniphier/clk-uniphier-core.c       |  6 ++----
 drivers/clk/x86/clk-fch.c                      |  7 +++----
 drivers/clk/x86/clk-pmc-atom.c                 |  5 ++---
 drivers/clk/xilinx/clk-xlnx-clock-wizard.c     |  6 ++----
 drivers/clk/xilinx/xlnx_vcu.c                  |  8 ++------
 159 files changed, 234 insertions(+), 335 deletions(-)


base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
-- 
2.39.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 14/30] clk: s2mps11: Convert to platform remove callback returning void
  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:22   ` Krzysztof Kozlowski
  2023-03-29  2:37   ` Stephen Boyd
  2023-03-12 16:15 ` [PATCH 24/30] clk: samsung: " Uwe Kleine-König
  2023-03-15 23:35 ` (subset) [PATCH 00/30] clk: " Bjorn Andersson
  2 siblings, 2 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2023-03-12 16:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Michael Turquette, Stephen Boyd
  Cc: linux-kernel, linux-samsung-soc, linux-clk

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/clk-s2mps11.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index a3e883a9f406..38c456540d1b 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -202,7 +202,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int s2mps11_clk_remove(struct platform_device *pdev)
+static void s2mps11_clk_remove(struct platform_device *pdev)
 {
 	struct s2mps11_clk *s2mps11_clks = platform_get_drvdata(pdev);
 	int i;
@@ -217,8 +217,6 @@ static int s2mps11_clk_remove(struct platform_device *pdev)
 			continue;
 		clkdev_drop(s2mps11_clks[i].lookup);
 	}
-
-	return 0;
 }
 
 static const struct platform_device_id s2mps11_clk_id[] = {
@@ -265,7 +263,7 @@ static struct platform_driver s2mps11_clk_driver = {
 		.name  = "s2mps11-clk",
 	},
 	.probe = s2mps11_clk_probe,
-	.remove = s2mps11_clk_remove,
+	.remove_new = s2mps11_clk_remove,
 	.id_table = s2mps11_clk_id,
 };
 module_platform_driver(s2mps11_clk_driver);
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 24/30] clk: samsung: Convert to platform remove callback returning void
  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 ` [PATCH 14/30] clk: s2mps11: " Uwe Kleine-König
@ 2023-03-12 16:15 ` Uwe Kleine-König
  2023-03-12 16:33   ` (subset) " Krzysztof Kozlowski
  2023-03-15 23:35 ` (subset) [PATCH 00/30] clk: " Bjorn Andersson
  2 siblings, 1 reply; 7+ messages in thread
From: Uwe Kleine-König @ 2023-03-12 16:15 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Sylwester Nawrocki, Tomasz Figa,
	Chanwoo Choi, Michael Turquette, Stephen Boyd
  Cc: Alim Akhtar, linux-samsung-soc, linux-clk, linux-arm-kernel,
	linux-kernel

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 14/30] clk: s2mps11: Convert to platform remove callback returning void
  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
  1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-12 16:22 UTC (permalink / raw)
  To: Uwe Kleine-König, Michael Turquette, Stephen Boyd
  Cc: linux-kernel, linux-samsung-soc, linux-clk

On 12/03/2023 17:14, Uwe Kleine-König wrote:
> 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>

FWIW:

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: (subset) [PATCH 24/30] clk: samsung: Convert to platform remove callback returning void
  2023-03-12 16:15 ` [PATCH 24/30] clk: samsung: " Uwe Kleine-König
@ 2023-03-12 16:33   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-12 16:33 UTC (permalink / raw)
  To: Michael Turquette, Chanwoo Choi, Tomasz Figa, Sylwester Nawrocki,
	Uwe Kleine-König, Stephen Boyd
  Cc: Krzysztof Kozlowski, linux-arm-kernel, Alim Akhtar,
	linux-samsung-soc, linux-clk, linux-kernel

On Sun, 12 Mar 2023 17:15:06 +0100, Uwe Kleine-König wrote:
> 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.
> 
> [...]


You mentioned some dependency of v6.3-rc1, so I assume there is no dependency.
There is never a need to mention RC1 dependencies. Maintainer's tree must be
based on it.

Applied, thanks!

[24/30] clk: samsung: Convert to platform remove callback returning void
        https://git.kernel.org/krzk/linux/c/e853fb1803f60da69db82d41d92e30539a859227

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: (subset) [PATCH 00/30] clk: Convert to platform remove callback returning void
  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 ` [PATCH 14/30] clk: s2mps11: " Uwe Kleine-König
  2023-03-12 16:15 ` [PATCH 24/30] clk: samsung: " Uwe Kleine-König
@ 2023-03-15 23:35 ` Bjorn Andersson
  2 siblings, 0 replies; 7+ messages in thread
From: Bjorn Andersson @ 2023-03-15 23:35 UTC (permalink / raw)
  To: Tero Kristo, Alexandre Torgue, Chanwoo Choi, Krzysztof Kozlowski,
	Santosh Shilimkar, Eugeniy Paltsev, Michal Simek, Nishanth Menon,
	Michael Turquette, Peter De Schrijver, Maxime Coquelin,
	Thierry Reding, Geert Uytterhoeven, Tomasz Figa, Stephen Boyd,
	Uwe Kleine-König, Sylwester Nawrocki, Andy Gross,
	Masami Hiramatsu, Kunihiko Hayashi, Florian Fainelli,
	Sudeep Holla, Jonathan Hunter, Prashant Gaikwad,
	Matthias Brugger
  Cc: linux-arm-msm, Konrad Dybcio, Alim Akhtar, linux-tegra,
	AngeloGioacchino Del Regno, linux-stm32,
	Broadcom internal kernel review list, linux-samsung-soc,
	linux-kernel, linux-arm-kernel, linux-mediatek, linux-clk,
	linux-omap, Cristian Marussi, linux-rpi-kernel,
	linux-renesas-soc

On Sun, 12 Mar 2023 17:14:42 +0100, Uwe Kleine-König wrote:
> this patch series adapts the platform drivers below drivers/clk
> to use the .remove_new() callback. Compared to the traditional .remove()
> callback .remove_new() returns no value. This is a good thing because
> the driver core doesn't (and cannot) cope for errors during remove. The
> only effect of a non-zero return value in .remove() is that the driver
> core emits a warning. The device is removed anyhow and an early return
> from .remove() usually yields a resource leak.
> 
> [...]

Applied, thanks!

[22/30] clk: qcom: Convert to platform remove callback returning void
        commit: c4dc24da5286742f8cc728379f6115c9e886a8a4

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 14/30] clk: s2mps11: Convert to platform remove callback returning void
  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
  1 sibling, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2023-03-29  2:37 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Michael Turquette, Uwe Kleine-König
  Cc: linux-kernel, linux-samsung-soc, linux-clk

Quoting Uwe Kleine-König (2023-03-12 09:14:56)
> 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>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-03-29  2:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [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:15 ` [PATCH 24/30] clk: samsung: " Uwe Kleine-König
2023-03-12 16:33   ` (subset) " Krzysztof Kozlowski
2023-03-15 23:35 ` (subset) [PATCH 00/30] clk: " Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).