linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/41] rtc: Convert to platform remove callback returning void
@ 2023-03-04 13:29 Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 01/41] rtc: 88pm80x: " Uwe Kleine-König
                   ` (44 more replies)
  0 siblings, 45 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Linus Walleij,
	Nicolas Ferre, Claudiu Beznea, Florian Fainelli, Benson Leung,
	Joshua Kinard, Hans Ulli Kroll, Vladimir Zapolskiy, Chanwoo Choi,
	Krzysztof Kozlowski, Conor Dooley, Daire McNamara, Eddie Huang,
	Sean Wang, Matthias Brugger, Miquel Raynal, Maxime Coquelin,
	Alexandre Torgue, Vincent Shih, Thierry Reding, Jonathan Hunter,
	Michal Simek
  Cc: linux-rtc, linux-arm-kernel,
	Broadcom internal kernel review list, Guenter Roeck,
	chrome-platform, linux-riscv, AngeloGioacchino Del Regno,
	linux-mediatek, linux-renesas-soc, linux-stm32, linux-tegra,
	patches, kernel

Hello,

this patch series adapts the platform drivers below drivers/rtc 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.

By changing the remove callback to return void driver authors cannot reasonably
assume any more that there is some kind of cleanup later.

All drivers touched here returned zero unconditionally in their remove
callback, so they could all be converted trivially to .remove_new().

Note that this series depends on commit 5c5a7680e67b ("platform: Provide a
remove callback that returns no value") that is already in Linus' tree but not
yet included in a tagged version. I guess this will change tomorrow.

Best regards
Uwe

Uwe Kleine-König (41):
  rtc: 88pm80x: Convert to platform remove callback returning void
  rtc: 88pm860x: Convert to platform remove callback returning void
  rtc: ab8500: Convert to platform remove callback returning void
  rtc: ac100: Convert to platform remove callback returning void
  rtc: asm9260: Convert to platform remove callback returning void
  rtc: at91sam9: Convert to platform remove callback returning void
  rtc: brcmstb-waketimer: Convert to platform remove callback returning void
  rtc: cadence: Convert to platform remove callback returning void
  rtc: cmos: Convert to platform remove callback returning void
  rtc: cros-ec: Convert to platform remove callback returning void
  rtc: ds1685: Convert to platform remove callback returning void
  rtc: ftrtc010: Convert to platform remove callback returning void
  rtc: hid-sensor-time: Convert to platform remove callback returning void
  rtc: lpc24xx: Convert to platform remove callback returning void
  rtc: max77686: Convert to platform remove callback returning void
  rtc: mc13xxx: Convert to platform remove callback returning void
  rtc: mpc5121: Convert to platform remove callback returning void
  rtc: mpfs: Convert to platform remove callback returning void
  rtc: mt7622: Convert to platform remove callback returning void
  rtc: mxc_v2: Convert to platform remove callback returning void
  rtc: omap: Convert to platform remove callback returning void
  rtc: palmas: Convert to platform remove callback returning void
  rtc: pcf50633: Convert to platform remove callback returning void
  rtc: pic32: Convert to platform remove callback returning void
  rtc: pm8xxx: Convert to platform remove callback returning void
  rtc: rc5t583: Convert to platform remove callback returning void
  rtc: rtd119x: Convert to platform remove callback returning void
  rtc: rzn1: Convert to platform remove callback returning void
  rtc: s3c: Convert to platform remove callback returning void
  rtc: sa1100: Convert to platform remove callback returning void
  rtc: spear: Convert to platform remove callback returning void
  rtc: stm32: Convert to platform remove callback returning void
  rtc: stmp3xxx: Convert to platform remove callback returning void
  rtc: sunplus: Convert to platform remove callback returning void
  rtc: tegra: Convert to platform remove callback returning void
  rtc: tps6586x: Convert to platform remove callback returning void
  rtc: twl: Convert to platform remove callback returning void
  rtc: vt8500: Convert to platform remove callback returning void
  rtc: wm8350: Convert to platform remove callback returning void
  rtc: xgene: Convert to platform remove callback returning void
  rtc: zynqmp: Convert to platform remove callback returning void

 drivers/rtc/rtc-88pm80x.c           | 5 ++---
 drivers/rtc/rtc-88pm860x.c          | 6 ++----
 drivers/rtc/rtc-ab8500.c            | 6 ++----
 drivers/rtc/rtc-ac100.c             | 6 ++----
 drivers/rtc/rtc-asm9260.c           | 5 ++---
 drivers/rtc/rtc-at91sam9.c          | 6 ++----
 drivers/rtc/rtc-brcmstb-waketimer.c | 6 ++----
 drivers/rtc/rtc-cadence.c           | 6 ++----
 drivers/rtc/rtc-cmos.c              | 5 ++---
 drivers/rtc/rtc-cros-ec.c           | 6 ++----
 drivers/rtc/rtc-ds1685.c            | 6 ++----
 drivers/rtc/rtc-ftrtc010.c          | 6 ++----
 drivers/rtc/rtc-hid-sensor-time.c   | 6 ++----
 drivers/rtc/rtc-lpc24xx.c           | 6 ++----
 drivers/rtc/rtc-max77686.c          | 6 ++----
 drivers/rtc/rtc-mc13xxx.c           | 6 ++----
 drivers/rtc/rtc-mpc5121.c           | 6 ++----
 drivers/rtc/rtc-mpfs.c              | 6 ++----
 drivers/rtc/rtc-mt7622.c            | 6 ++----
 drivers/rtc/rtc-mxc_v2.c            | 5 ++---
 drivers/rtc/rtc-omap.c              | 6 ++----
 drivers/rtc/rtc-palmas.c            | 5 ++---
 drivers/rtc/rtc-pcf50633.c          | 6 ++----
 drivers/rtc/rtc-pic32.c             | 6 ++----
 drivers/rtc/rtc-pm8xxx.c            | 5 ++---
 drivers/rtc/rtc-rc5t583.c           | 5 ++---
 drivers/rtc/rtc-rtd119x.c           | 6 ++----
 drivers/rtc/rtc-rzn1.c              | 6 ++----
 drivers/rtc/rtc-s3c.c               | 6 ++----
 drivers/rtc/rtc-sa1100.c            | 6 ++----
 drivers/rtc/rtc-spear.c             | 6 ++----
 drivers/rtc/rtc-stm32.c             | 6 ++----
 drivers/rtc/rtc-stmp3xxx.c          | 8 +++-----
 drivers/rtc/rtc-sunplus.c           | 6 ++----
 drivers/rtc/rtc-tegra.c             | 6 ++----
 drivers/rtc/rtc-tps6586x.c          | 5 ++---
 drivers/rtc/rtc-twl.c               | 6 ++----
 drivers/rtc/rtc-vt8500.c            | 6 ++----
 drivers/rtc/rtc-wm8350.c            | 6 ++----
 drivers/rtc/rtc-xgene.c             | 5 ++---
 drivers/rtc/rtc-zynqmp.c            | 6 ++----
 41 files changed, 83 insertions(+), 156 deletions(-)

base-commit: 0988a0ea791999ebbf95693f2676381825b05033
-- 
2.39.1


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

* [PATCH 01/41] rtc: 88pm80x: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 02/41] rtc: 88pm860x: " Uwe Kleine-König
                   ` (43 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-88pm80x.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-88pm80x.c b/drivers/rtc/rtc-88pm80x.c
index 6a3f44cf6ebe..f40cc06b0979 100644
--- a/drivers/rtc/rtc-88pm80x.c
+++ b/drivers/rtc/rtc-88pm80x.c
@@ -317,11 +317,10 @@ static int pm80x_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pm80x_rtc_remove(struct platform_device *pdev)
+static void pm80x_rtc_remove(struct platform_device *pdev)
 {
 	struct pm80x_rtc_info *info = platform_get_drvdata(pdev);
 	pm80x_free_irq(info->chip, info->irq, info);
-	return 0;
 }
 
 static struct platform_driver pm80x_rtc_driver = {
@@ -330,7 +329,7 @@ static struct platform_driver pm80x_rtc_driver = {
 		   .pm = &pm80x_rtc_pm_ops,
 		   },
 	.probe = pm80x_rtc_probe,
-	.remove = pm80x_rtc_remove,
+	.remove_new = pm80x_rtc_remove,
 };
 
 module_platform_driver(pm80x_rtc_driver);
-- 
2.39.1


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

* [PATCH 02/41] rtc: 88pm860x: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 01/41] rtc: 88pm80x: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 03/41] rtc: ab8500: " Uwe Kleine-König
                   ` (42 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-88pm860x.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-88pm860x.c b/drivers/rtc/rtc-88pm860x.c
index 2c809a1a445e..0f124ed5b3e5 100644
--- a/drivers/rtc/rtc-88pm860x.c
+++ b/drivers/rtc/rtc-88pm860x.c
@@ -331,7 +331,7 @@ static int pm860x_rtc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int pm860x_rtc_remove(struct platform_device *pdev)
+static void pm860x_rtc_remove(struct platform_device *pdev)
 {
 	struct pm860x_rtc_info *info = platform_get_drvdata(pdev);
 
@@ -340,8 +340,6 @@ static int pm860x_rtc_remove(struct platform_device *pdev)
 	/* disable measurement */
 	pm860x_set_bits(info->i2c, PM8607_MEAS_EN2, MEAS2_VRTC, 0);
 #endif	/* VRTC_CALIBRATION */
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -373,7 +371,7 @@ static struct platform_driver pm860x_rtc_driver = {
 		.pm	= &pm860x_rtc_pm_ops,
 	},
 	.probe		= pm860x_rtc_probe,
-	.remove		= pm860x_rtc_remove,
+	.remove_new	= pm860x_rtc_remove,
 };
 
 module_platform_driver(pm860x_rtc_driver);
-- 
2.39.1


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

* [PATCH 03/41] rtc: ab8500: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 01/41] rtc: 88pm80x: " Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 02/41] rtc: 88pm860x: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-07 13:35   ` Linus Walleij
  2023-03-04 13:29 ` [PATCH 04/41] rtc: ac100: " Uwe Kleine-König
                   ` (41 subsequent siblings)
  44 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Linus Walleij, Alessandro Zummo, Alexandre Belloni
  Cc: linux-arm-kernel, linux-rtc, 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/rtc/rtc-ab8500.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index ea33e149d545..75bb2ac9005c 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -392,12 +392,10 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
 	return devm_rtc_register_device(rtc);
 }
 
-static int ab8500_rtc_remove(struct platform_device *pdev)
+static void ab8500_rtc_remove(struct platform_device *pdev)
 {
 	dev_pm_clear_wake_irq(&pdev->dev);
 	device_init_wakeup(&pdev->dev, false);
-
-	return 0;
 }
 
 static struct platform_driver ab8500_rtc_driver = {
@@ -405,7 +403,7 @@ static struct platform_driver ab8500_rtc_driver = {
 		.name = "ab8500-rtc",
 	},
 	.probe	= ab8500_rtc_probe,
-	.remove = ab8500_rtc_remove,
+	.remove_new = ab8500_rtc_remove,
 	.id_table = ab85xx_rtc_ids,
 };
 
-- 
2.39.1


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

* [PATCH 04/41] rtc: ac100: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-03-04 13:29 ` [PATCH 03/41] rtc: ab8500: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 05/41] rtc: asm9260: " Uwe Kleine-König
                   ` (40 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-ac100.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-ac100.c b/drivers/rtc/rtc-ac100.c
index 66783cb5e711..eaf2c9ab9661 100644
--- a/drivers/rtc/rtc-ac100.c
+++ b/drivers/rtc/rtc-ac100.c
@@ -613,13 +613,11 @@ static int ac100_rtc_probe(struct platform_device *pdev)
 	return devm_rtc_register_device(chip->rtc);
 }
 
-static int ac100_rtc_remove(struct platform_device *pdev)
+static void ac100_rtc_remove(struct platform_device *pdev)
 {
 	struct ac100_rtc_dev *chip = platform_get_drvdata(pdev);
 
 	ac100_rtc_unregister_clks(chip);
-
-	return 0;
 }
 
 static const struct of_device_id ac100_rtc_match[] = {
@@ -630,7 +628,7 @@ MODULE_DEVICE_TABLE(of, ac100_rtc_match);
 
 static struct platform_driver ac100_rtc_driver = {
 	.probe		= ac100_rtc_probe,
-	.remove		= ac100_rtc_remove,
+	.remove_new	= ac100_rtc_remove,
 	.driver		= {
 		.name		= "ac100-rtc",
 		.of_match_table	= of_match_ptr(ac100_rtc_match),
-- 
2.39.1


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

* [PATCH 05/41] rtc: asm9260: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2023-03-04 13:29 ` [PATCH 04/41] rtc: ac100: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 06/41] rtc: at91sam9: " Uwe Kleine-König
                   ` (39 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-asm9260.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-asm9260.c b/drivers/rtc/rtc-asm9260.c
index de795e489f71..a83b47e0d8f5 100644
--- a/drivers/rtc/rtc-asm9260.c
+++ b/drivers/rtc/rtc-asm9260.c
@@ -308,14 +308,13 @@ static int asm9260_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int asm9260_rtc_remove(struct platform_device *pdev)
+static void asm9260_rtc_remove(struct platform_device *pdev)
 {
 	struct asm9260_rtc_priv *priv = platform_get_drvdata(pdev);
 
 	/* Disable alarm matching */
 	iowrite32(BM_AMR_OFF, priv->iobase + HW_AMR);
 	clk_disable_unprepare(priv->clk);
-	return 0;
 }
 
 static const struct of_device_id asm9260_dt_ids[] = {
@@ -326,7 +325,7 @@ MODULE_DEVICE_TABLE(of, asm9260_dt_ids);
 
 static struct platform_driver asm9260_rtc_driver = {
 	.probe		= asm9260_rtc_probe,
-	.remove		= asm9260_rtc_remove,
+	.remove_new	= asm9260_rtc_remove,
 	.driver		= {
 		.name	= "asm9260-rtc",
 		.of_match_table = asm9260_dt_ids,
-- 
2.39.1


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

* [PATCH 06/41] rtc: at91sam9: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2023-03-04 13:29 ` [PATCH 05/41] rtc: asm9260: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-06 11:55   ` Claudiu.Beznea
  2023-03-04 13:29 ` [PATCH 07/41] rtc: brcmstb-waketimer: " Uwe Kleine-König
                   ` (38 subsequent siblings)
  44 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Nicolas Ferre, Claudiu Beznea
  Cc: linux-rtc, linux-arm-kernel, 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/rtc/rtc-at91sam9.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index b7b5ea1a4e67..610f27dfc462 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -442,7 +442,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
 /*
  * Disable and remove the RTC driver
  */
-static int at91_rtc_remove(struct platform_device *pdev)
+static void at91_rtc_remove(struct platform_device *pdev)
 {
 	struct sam9_rtc	*rtc = platform_get_drvdata(pdev);
 	u32		mr = rtt_readl(rtc, MR);
@@ -451,8 +451,6 @@ static int at91_rtc_remove(struct platform_device *pdev)
 	rtt_writel(rtc, MR, mr & ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN));
 
 	clk_disable_unprepare(rtc->sclk);
-
-	return 0;
 }
 
 static void at91_rtc_shutdown(struct platform_device *pdev)
@@ -531,7 +529,7 @@ MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids);
 
 static struct platform_driver at91_rtc_driver = {
 	.probe		= at91_rtc_probe,
-	.remove		= at91_rtc_remove,
+	.remove_new	= at91_rtc_remove,
 	.shutdown	= at91_rtc_shutdown,
 	.driver		= {
 		.name	= "rtc-at91sam9",
-- 
2.39.1


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

* [PATCH 07/41] rtc: brcmstb-waketimer: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2023-03-04 13:29 ` [PATCH 06/41] rtc: at91sam9: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 08/41] rtc: cadence: " Uwe Kleine-König
                   ` (37 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Florian Fainelli
  Cc: Broadcom internal kernel review list, linux-rtc,
	linux-arm-kernel, 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/rtc/rtc-brcmstb-waketimer.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-brcmstb-waketimer.c b/drivers/rtc/rtc-brcmstb-waketimer.c
index 1efa81cecc27..3cdc015692ca 100644
--- a/drivers/rtc/rtc-brcmstb-waketimer.c
+++ b/drivers/rtc/rtc-brcmstb-waketimer.c
@@ -336,14 +336,12 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int brcmstb_waketmr_remove(struct platform_device *pdev)
+static void brcmstb_waketmr_remove(struct platform_device *pdev)
 {
 	struct brcmstb_waketmr *timer = dev_get_drvdata(&pdev->dev);
 
 	unregister_reboot_notifier(&timer->reboot_notifier);
 	clk_disable_unprepare(timer->clk);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -382,7 +380,7 @@ static const __maybe_unused struct of_device_id brcmstb_waketmr_of_match[] = {
 
 static struct platform_driver brcmstb_waketmr_driver = {
 	.probe			= brcmstb_waketmr_probe,
-	.remove			= brcmstb_waketmr_remove,
+	.remove_new		= brcmstb_waketmr_remove,
 	.driver = {
 		.name		= "brcmstb-waketimer",
 		.pm		= &brcmstb_waketmr_pm_ops,
-- 
2.39.1


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

* [PATCH 08/41] rtc: cadence: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (6 preceding siblings ...)
  2023-03-04 13:29 ` [PATCH 07/41] rtc: brcmstb-waketimer: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 09/41] rtc: cmos: " Uwe Kleine-König
                   ` (36 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-cadence.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-cadence.c b/drivers/rtc/rtc-cadence.c
index 1edf7f16d73a..4ca60b519836 100644
--- a/drivers/rtc/rtc-cadence.c
+++ b/drivers/rtc/rtc-cadence.c
@@ -354,7 +354,7 @@ static int cdns_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int cdns_rtc_remove(struct platform_device *pdev)
+static void cdns_rtc_remove(struct platform_device *pdev)
 {
 	struct cdns_rtc *crtc = platform_get_drvdata(pdev);
 
@@ -363,8 +363,6 @@ static int cdns_rtc_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(crtc->pclk);
 	clk_disable_unprepare(crtc->ref_clk);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -404,7 +402,7 @@ static struct platform_driver cdns_rtc_driver = {
 		.pm = &cdns_rtc_pm_ops,
 	},
 	.probe = cdns_rtc_probe,
-	.remove = cdns_rtc_remove,
+	.remove_new = cdns_rtc_remove,
 };
 module_platform_driver(cdns_rtc_driver);
 
-- 
2.39.1


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

* [PATCH 09/41] rtc: cmos: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (7 preceding siblings ...)
  2023-03-04 13:29 ` [PATCH 08/41] rtc: cadence: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-04 13:29 ` [PATCH 10/41] rtc: cros-ec: " Uwe Kleine-König
                   ` (35 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-cmos.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 00e2ca7374ec..c9416fe8542d 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -1489,10 +1489,9 @@ static int __init cmos_platform_probe(struct platform_device *pdev)
 	return cmos_do_probe(&pdev->dev, resource, irq);
 }
 
-static int cmos_platform_remove(struct platform_device *pdev)
+static void cmos_platform_remove(struct platform_device *pdev)
 {
 	cmos_do_remove(&pdev->dev);
-	return 0;
 }
 
 static void cmos_platform_shutdown(struct platform_device *pdev)
@@ -1514,7 +1513,7 @@ static void cmos_platform_shutdown(struct platform_device *pdev)
 MODULE_ALIAS("platform:rtc_cmos");
 
 static struct platform_driver cmos_platform_driver = {
-	.remove		= cmos_platform_remove,
+	.remove_new	= cmos_platform_remove,
 	.shutdown	= cmos_platform_shutdown,
 	.driver = {
 		.name		= driver_name,
-- 
2.39.1


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

* [PATCH 10/41] rtc: cros-ec: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (8 preceding siblings ...)
  2023-03-04 13:29 ` [PATCH 09/41] rtc: cmos: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-07  5:30   ` Tzung-Bi Shih
  2023-03-04 13:29 ` [PATCH 11/41] rtc: ds1685: " Uwe Kleine-König
                   ` (34 subsequent siblings)
  44 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Benson Leung
  Cc: Guenter Roeck, linux-rtc, chrome-platform, 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/rtc/rtc-cros-ec.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-cros-ec.c b/drivers/rtc/rtc-cros-ec.c
index a3ec066d8066..998ab8606f0b 100644
--- a/drivers/rtc/rtc-cros-ec.c
+++ b/drivers/rtc/rtc-cros-ec.c
@@ -371,7 +371,7 @@ static int cros_ec_rtc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int cros_ec_rtc_remove(struct platform_device *pdev)
+static void cros_ec_rtc_remove(struct platform_device *pdev)
 {
 	struct cros_ec_rtc *cros_ec_rtc = platform_get_drvdata(pdev);
 	struct device *dev = &pdev->dev;
@@ -382,13 +382,11 @@ static int cros_ec_rtc_remove(struct platform_device *pdev)
 				&cros_ec_rtc->notifier);
 	if (ret)
 		dev_err(dev, "failed to unregister notifier\n");
-
-	return 0;
 }
 
 static struct platform_driver cros_ec_rtc_driver = {
 	.probe = cros_ec_rtc_probe,
-	.remove = cros_ec_rtc_remove,
+	.remove_new = cros_ec_rtc_remove,
 	.driver = {
 		.name = DRV_NAME,
 		.pm = &cros_ec_rtc_pm_ops,
-- 
2.39.1


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

* [PATCH 11/41] rtc: ds1685: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (9 preceding siblings ...)
  2023-03-04 13:29 ` [PATCH 10/41] rtc: cros-ec: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-06 19:43   ` Joshua Kinard
  2023-03-04 13:29 ` [PATCH 12/41] rtc: ftrtc010: " Uwe Kleine-König
                   ` (33 subsequent siblings)
  44 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Joshua Kinard, Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-ds1685.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
index 5db9c737c022..0f707be0eb87 100644
--- a/drivers/rtc/rtc-ds1685.c
+++ b/drivers/rtc/rtc-ds1685.c
@@ -1322,7 +1322,7 @@ ds1685_rtc_probe(struct platform_device *pdev)
  * ds1685_rtc_remove - removes rtc driver.
  * @pdev: pointer to platform_device structure.
  */
-static int
+static void
 ds1685_rtc_remove(struct platform_device *pdev)
 {
 	struct ds1685_priv *rtc = platform_get_drvdata(pdev);
@@ -1344,8 +1344,6 @@ ds1685_rtc_remove(struct platform_device *pdev)
 	rtc->write(rtc, RTC_EXT_CTRL_4A,
 		   (rtc->read(rtc, RTC_EXT_CTRL_4A) &
 		    ~(RTC_CTRL_4A_RWK_MASK)));
-
-	return 0;
 }
 
 /*
@@ -1356,7 +1354,7 @@ static struct platform_driver ds1685_rtc_driver = {
 		.name	= "rtc-ds1685",
 	},
 	.probe		= ds1685_rtc_probe,
-	.remove		= ds1685_rtc_remove,
+	.remove_new	= ds1685_rtc_remove,
 };
 module_platform_driver(ds1685_rtc_driver);
 /* ----------------------------------------------------------------------- */
-- 
2.39.1


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

* [PATCH 12/41] rtc: ftrtc010: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (10 preceding siblings ...)
  2023-03-04 13:29 ` [PATCH 11/41] rtc: ds1685: " Uwe Kleine-König
@ 2023-03-04 13:29 ` Uwe Kleine-König
  2023-03-07 13:35   ` Linus Walleij
  2023-03-04 13:30 ` [PATCH 13/41] rtc: hid-sensor-time: " Uwe Kleine-König
                   ` (32 subsequent siblings)
  44 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:29 UTC (permalink / raw)
  To: Hans Ulli Kroll, Linus Walleij, Alessandro Zummo, Alexandre Belloni
  Cc: linux-arm-kernel, linux-rtc, 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/rtc/rtc-ftrtc010.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c
index 25c6e7d9570f..8bfe7378f653 100644
--- a/drivers/rtc/rtc-ftrtc010.c
+++ b/drivers/rtc/rtc-ftrtc010.c
@@ -191,7 +191,7 @@ static int ftrtc010_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int ftrtc010_rtc_remove(struct platform_device *pdev)
+static void ftrtc010_rtc_remove(struct platform_device *pdev)
 {
 	struct ftrtc010_rtc *rtc = platform_get_drvdata(pdev);
 
@@ -199,8 +199,6 @@ static int ftrtc010_rtc_remove(struct platform_device *pdev)
 		clk_disable_unprepare(rtc->extclk);
 	if (!IS_ERR(rtc->pclk))
 		clk_disable_unprepare(rtc->pclk);
-
-	return 0;
 }
 
 static const struct of_device_id ftrtc010_rtc_dt_match[] = {
@@ -216,7 +214,7 @@ static struct platform_driver ftrtc010_rtc_driver = {
 		.of_match_table = ftrtc010_rtc_dt_match,
 	},
 	.probe		= ftrtc010_rtc_probe,
-	.remove		= ftrtc010_rtc_remove,
+	.remove_new	= ftrtc010_rtc_remove,
 };
 
 module_platform_driver_probe(ftrtc010_rtc_driver, ftrtc010_rtc_probe);
-- 
2.39.1


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

* [PATCH 13/41] rtc: hid-sensor-time: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (11 preceding siblings ...)
  2023-03-04 13:29 ` [PATCH 12/41] rtc: ftrtc010: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 14/41] rtc: lpc24xx: " Uwe Kleine-König
                   ` (31 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-hid-sensor-time.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c
index 16fdefafec5d..b81cea505ee9 100644
--- a/drivers/rtc/rtc-hid-sensor-time.c
+++ b/drivers/rtc/rtc-hid-sensor-time.c
@@ -296,14 +296,12 @@ static int hid_time_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int hid_time_remove(struct platform_device *pdev)
+static void hid_time_remove(struct platform_device *pdev)
 {
 	struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev);
 
 	sensor_hub_device_close(hsdev);
 	sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_TIME);
-
-	return 0;
 }
 
 static const struct platform_device_id hid_time_ids[] = {
@@ -321,7 +319,7 @@ static struct platform_driver hid_time_platform_driver = {
 		.name	= KBUILD_MODNAME,
 	},
 	.probe		= hid_time_probe,
-	.remove		= hid_time_remove,
+	.remove_new	= hid_time_remove,
 };
 module_platform_driver(hid_time_platform_driver);
 
-- 
2.39.1


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

* [PATCH 14/41] rtc: lpc24xx: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (12 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 13/41] rtc: hid-sensor-time: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 15/41] rtc: max77686: " Uwe Kleine-König
                   ` (30 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Vladimir Zapolskiy, Alessandro Zummo, Alexandre Belloni
  Cc: linux-arm-kernel, linux-rtc, 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/rtc/rtc-lpc24xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-lpc24xx.c b/drivers/rtc/rtc-lpc24xx.c
index eec881a81067..a4612e543f35 100644
--- a/drivers/rtc/rtc-lpc24xx.c
+++ b/drivers/rtc/rtc-lpc24xx.c
@@ -264,7 +264,7 @@ static int lpc24xx_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int lpc24xx_rtc_remove(struct platform_device *pdev)
+static void lpc24xx_rtc_remove(struct platform_device *pdev)
 {
 	struct lpc24xx_rtc *rtc = platform_get_drvdata(pdev);
 
@@ -276,8 +276,6 @@ static int lpc24xx_rtc_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(rtc->clk_rtc);
 	clk_disable_unprepare(rtc->clk_reg);
-
-	return 0;
 }
 
 static const struct of_device_id lpc24xx_rtc_match[] = {
@@ -288,7 +286,7 @@ MODULE_DEVICE_TABLE(of, lpc24xx_rtc_match);
 
 static struct platform_driver lpc24xx_rtc_driver = {
 	.probe	= lpc24xx_rtc_probe,
-	.remove	= lpc24xx_rtc_remove,
+	.remove_new = lpc24xx_rtc_remove,
 	.driver	= {
 		.name = "lpc24xx-rtc",
 		.of_match_table	= lpc24xx_rtc_match,
-- 
2.39.1


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

* [PATCH 15/41] rtc: max77686: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (13 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 14/41] rtc: lpc24xx: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-05  9:50   ` Krzysztof Kozlowski
  2023-03-04 13:30 ` [PATCH 16/41] rtc: mc13xxx: " Uwe Kleine-König
                   ` (29 subsequent siblings)
  44 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Chanwoo Choi, Krzysztof Kozlowski, Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, 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/rtc/rtc-max77686.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
index b0250d91fb00..35a6021d9ba4 100644
--- a/drivers/rtc/rtc-max77686.c
+++ b/drivers/rtc/rtc-max77686.c
@@ -806,14 +806,12 @@ static int max77686_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int max77686_rtc_remove(struct platform_device *pdev)
+static void max77686_rtc_remove(struct platform_device *pdev)
 {
 	struct max77686_rtc_info *info = platform_get_drvdata(pdev);
 
 	free_irq(info->virq, info);
 	regmap_del_irq_chip(info->rtc_irq, info->rtc_irq_data);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -877,7 +875,7 @@ static struct platform_driver max77686_rtc_driver = {
 		.pm	= &max77686_rtc_pm_ops,
 	},
 	.probe		= max77686_rtc_probe,
-	.remove		= max77686_rtc_remove,
+	.remove_new	= max77686_rtc_remove,
 	.id_table	= rtc_id,
 };
 
-- 
2.39.1


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

* [PATCH 16/41] rtc: mc13xxx: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (14 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 15/41] rtc: max77686: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 17/41] rtc: mpc5121: " Uwe Kleine-König
                   ` (28 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-mc13xxx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-mc13xxx.c b/drivers/rtc/rtc-mc13xxx.c
index d4234e78497e..763a42f422eb 100644
--- a/drivers/rtc/rtc-mc13xxx.c
+++ b/drivers/rtc/rtc-mc13xxx.c
@@ -324,7 +324,7 @@ static int __init mc13xxx_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mc13xxx_rtc_remove(struct platform_device *pdev)
+static void mc13xxx_rtc_remove(struct platform_device *pdev)
 {
 	struct mc13xxx_rtc *priv = platform_get_drvdata(pdev);
 
@@ -334,8 +334,6 @@ static int mc13xxx_rtc_remove(struct platform_device *pdev)
 	mc13xxx_irq_free(priv->mc13xxx, MC13XXX_IRQ_RTCRST, priv);
 
 	mc13xxx_unlock(priv->mc13xxx);
-
-	return 0;
 }
 
 static const struct platform_device_id mc13xxx_rtc_idtable[] = {
@@ -352,7 +350,7 @@ MODULE_DEVICE_TABLE(platform, mc13xxx_rtc_idtable);
 
 static struct platform_driver mc13xxx_rtc_driver = {
 	.id_table = mc13xxx_rtc_idtable,
-	.remove = mc13xxx_rtc_remove,
+	.remove_new = mc13xxx_rtc_remove,
 	.driver = {
 		.name = DRIVER_NAME,
 	},
-- 
2.39.1


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

* [PATCH 17/41] rtc: mpc5121: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (15 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 16/41] rtc: mc13xxx: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 18/41] rtc: mpfs: " Uwe Kleine-König
                   ` (27 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-mpc5121.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-mpc5121.c b/drivers/rtc/rtc-mpc5121.c
index 6d7656a75cae..07df43e4c4d0 100644
--- a/drivers/rtc/rtc-mpc5121.c
+++ b/drivers/rtc/rtc-mpc5121.c
@@ -372,7 +372,7 @@ static int mpc5121_rtc_probe(struct platform_device *op)
 	return err;
 }
 
-static int mpc5121_rtc_remove(struct platform_device *op)
+static void mpc5121_rtc_remove(struct platform_device *op)
 {
 	struct mpc5121_rtc_data *rtc = platform_get_drvdata(op);
 	struct mpc5121_rtc_regs __iomem *regs = rtc->regs;
@@ -383,8 +383,6 @@ static int mpc5121_rtc_remove(struct platform_device *op)
 
 	irq_dispose_mapping(rtc->irq);
 	irq_dispose_mapping(rtc->irq_periodic);
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -402,7 +400,7 @@ static struct platform_driver mpc5121_rtc_driver = {
 		.of_match_table = of_match_ptr(mpc5121_rtc_match),
 	},
 	.probe = mpc5121_rtc_probe,
-	.remove = mpc5121_rtc_remove,
+	.remove_new = mpc5121_rtc_remove,
 };
 
 module_platform_driver(mpc5121_rtc_driver);
-- 
2.39.1


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

* [PATCH 18/41] rtc: mpfs: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (16 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 17/41] rtc: mpc5121: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:47   ` Conor Dooley
  2023-03-04 13:30 ` [PATCH 19/41] rtc: mt7622: " Uwe Kleine-König
                   ` (26 subsequent siblings)
  44 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Conor Dooley, Daire McNamara, Alessandro Zummo, Alexandre Belloni
  Cc: linux-riscv, linux-rtc, 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/rtc/rtc-mpfs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-mpfs.c b/drivers/rtc/rtc-mpfs.c
index 2a479d44f198..5b96a6d39210 100644
--- a/drivers/rtc/rtc-mpfs.c
+++ b/drivers/rtc/rtc-mpfs.c
@@ -274,11 +274,9 @@ static int mpfs_rtc_probe(struct platform_device *pdev)
 	return devm_rtc_register_device(rtcdev->rtc);
 }
 
-static int mpfs_rtc_remove(struct platform_device *pdev)
+static void mpfs_rtc_remove(struct platform_device *pdev)
 {
 	dev_pm_clear_wake_irq(&pdev->dev);
-
-	return 0;
 }
 
 static const struct of_device_id mpfs_rtc_of_match[] = {
@@ -290,7 +288,7 @@ MODULE_DEVICE_TABLE(of, mpfs_rtc_of_match);
 
 static struct platform_driver mpfs_rtc_driver = {
 	.probe = mpfs_rtc_probe,
-	.remove = mpfs_rtc_remove,
+	.remove_new = mpfs_rtc_remove,
 	.driver	= {
 		.name = "mpfs_rtc",
 		.of_match_table = mpfs_rtc_of_match,
-- 
2.39.1


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

* [PATCH 19/41] rtc: mt7622: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (17 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 18/41] rtc: mpfs: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 20/41] rtc: mxc_v2: " Uwe Kleine-König
                   ` (25 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Eddie Huang, Sean Wang, Alessandro Zummo, Alexandre Belloni,
	Matthias Brugger
  Cc: AngeloGioacchino Del Regno, linux-arm-kernel, linux-mediatek,
	linux-rtc, 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/rtc/rtc-mt7622.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-mt7622.c b/drivers/rtc/rtc-mt7622.c
index f1e356394814..81857a457c32 100644
--- a/drivers/rtc/rtc-mt7622.c
+++ b/drivers/rtc/rtc-mt7622.c
@@ -357,13 +357,11 @@ static int mtk_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mtk_rtc_remove(struct platform_device *pdev)
+static void mtk_rtc_remove(struct platform_device *pdev)
 {
 	struct mtk_rtc *hw = platform_get_drvdata(pdev);
 
 	clk_disable_unprepare(hw->clk);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -396,7 +394,7 @@ static SIMPLE_DEV_PM_OPS(mtk_rtc_pm_ops, mtk_rtc_suspend, mtk_rtc_resume);
 
 static struct platform_driver mtk_rtc_driver = {
 	.probe	= mtk_rtc_probe,
-	.remove	= mtk_rtc_remove,
+	.remove_new = mtk_rtc_remove,
 	.driver = {
 		.name = MTK_RTC_DEV,
 		.of_match_table = mtk_rtc_match,
-- 
2.39.1


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

* [PATCH 20/41] rtc: mxc_v2: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (18 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 19/41] rtc: mt7622: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 21/41] rtc: omap: " Uwe Kleine-König
                   ` (24 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-mxc_v2.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
index f6d2ad91ff7a..6934bce4b29f 100644
--- a/drivers/rtc/rtc-mxc_v2.c
+++ b/drivers/rtc/rtc-mxc_v2.c
@@ -362,12 +362,11 @@ static int mxc_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mxc_rtc_remove(struct platform_device *pdev)
+static void mxc_rtc_remove(struct platform_device *pdev)
 {
 	struct mxc_rtc_data *pdata = platform_get_drvdata(pdev);
 
 	clk_disable_unprepare(pdata->clk);
-	return 0;
 }
 
 static const struct of_device_id mxc_ids[] = {
@@ -382,7 +381,7 @@ static struct platform_driver mxc_rtc_driver = {
 		.of_match_table = mxc_ids,
 	},
 	.probe = mxc_rtc_probe,
-	.remove = mxc_rtc_remove,
+	.remove_new = mxc_rtc_remove,
 };
 
 module_platform_driver(mxc_rtc_driver);
-- 
2.39.1


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

* [PATCH 21/41] rtc: omap: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (19 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 20/41] rtc: mxc_v2: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 22/41] rtc: palmas: " Uwe Kleine-König
                   ` (23 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-omap.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 4d4f3b1a7309..fad30b3dde46 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -910,7 +910,7 @@ static int omap_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int omap_rtc_remove(struct platform_device *pdev)
+static void omap_rtc_remove(struct platform_device *pdev)
 {
 	struct omap_rtc *rtc = platform_get_drvdata(pdev);
 	u8 reg;
@@ -941,8 +941,6 @@ static int omap_rtc_remove(struct platform_device *pdev)
 	/* Disable the clock/module */
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static int __maybe_unused omap_rtc_suspend(struct device *dev)
@@ -1017,7 +1015,7 @@ static void omap_rtc_shutdown(struct platform_device *pdev)
 
 static struct platform_driver omap_rtc_driver = {
 	.probe		= omap_rtc_probe,
-	.remove		= omap_rtc_remove,
+	.remove_new	= omap_rtc_remove,
 	.shutdown	= omap_rtc_shutdown,
 	.driver		= {
 		.name	= "omap_rtc",
-- 
2.39.1


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

* [PATCH 22/41] rtc: palmas: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (20 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 21/41] rtc: omap: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 23/41] rtc: pcf50633: " Uwe Kleine-König
                   ` (22 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-palmas.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-palmas.c b/drivers/rtc/rtc-palmas.c
index 67571f7f0bbc..6971e47c6021 100644
--- a/drivers/rtc/rtc-palmas.c
+++ b/drivers/rtc/rtc-palmas.c
@@ -308,10 +308,9 @@ static int palmas_rtc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int palmas_rtc_remove(struct platform_device *pdev)
+static void palmas_rtc_remove(struct platform_device *pdev)
 {
 	palmas_rtc_alarm_irq_enable(&pdev->dev, 0);
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -347,7 +346,7 @@ MODULE_DEVICE_TABLE(of, of_palmas_rtc_match);
 
 static struct platform_driver palmas_rtc_driver = {
 	.probe		= palmas_rtc_probe,
-	.remove		= palmas_rtc_remove,
+	.remove_new	= palmas_rtc_remove,
 	.driver		= {
 		.name	= "palmas-rtc",
 		.pm	= &palmas_rtc_pm_ops,
-- 
2.39.1


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

* [PATCH 23/41] rtc: pcf50633: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (21 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 22/41] rtc: palmas: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 24/41] rtc: pic32: " Uwe Kleine-König
                   ` (21 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-pcf50633.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c
index 48951a16d65d..23edd11aa40c 100644
--- a/drivers/rtc/rtc-pcf50633.c
+++ b/drivers/rtc/rtc-pcf50633.c
@@ -260,14 +260,12 @@ static int pcf50633_rtc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int pcf50633_rtc_remove(struct platform_device *pdev)
+static void pcf50633_rtc_remove(struct platform_device *pdev)
 {
 	struct pcf50633_rtc *rtc;
 
 	rtc = platform_get_drvdata(pdev);
 	pcf50633_free_irq(rtc->pcf, PCF50633_IRQ_ALARM);
-
-	return 0;
 }
 
 static struct platform_driver pcf50633_rtc_driver = {
@@ -275,7 +273,7 @@ static struct platform_driver pcf50633_rtc_driver = {
 		.name = "pcf50633-rtc",
 	},
 	.probe = pcf50633_rtc_probe,
-	.remove = pcf50633_rtc_remove,
+	.remove_new = pcf50633_rtc_remove,
 };
 
 module_platform_driver(pcf50633_rtc_driver);
-- 
2.39.1


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

* [PATCH 24/41] rtc: pic32: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (22 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 23/41] rtc: pcf50633: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 25/41] rtc: pm8xxx: " Uwe Kleine-König
                   ` (20 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-pic32.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-pic32.c b/drivers/rtc/rtc-pic32.c
index fa351ac20158..4f85e0c3d757 100644
--- a/drivers/rtc/rtc-pic32.c
+++ b/drivers/rtc/rtc-pic32.c
@@ -284,15 +284,13 @@ static void pic32_rtc_enable(struct pic32_rtc_dev *pdata, int en)
 	clk_disable(pdata->clk);
 }
 
-static int pic32_rtc_remove(struct platform_device *pdev)
+static void pic32_rtc_remove(struct platform_device *pdev)
 {
 	struct pic32_rtc_dev *pdata = platform_get_drvdata(pdev);
 
 	pic32_rtc_setaie(&pdev->dev, 0);
 	clk_unprepare(pdata->clk);
 	pdata->clk = NULL;
-
-	return 0;
 }
 
 static int pic32_rtc_probe(struct platform_device *pdev)
@@ -373,7 +371,7 @@ MODULE_DEVICE_TABLE(of, pic32_rtc_dt_ids);
 
 static struct platform_driver pic32_rtc_driver = {
 	.probe		= pic32_rtc_probe,
-	.remove		= pic32_rtc_remove,
+	.remove_new	= pic32_rtc_remove,
 	.driver		= {
 		.name	= "pic32-rtc",
 		.of_match_table	= of_match_ptr(pic32_rtc_dt_ids),
-- 
2.39.1


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

* [PATCH 25/41] rtc: pm8xxx: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (23 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 24/41] rtc: pic32: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 26/41] rtc: rc5t583: " Uwe Kleine-König
                   ` (19 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-pm8xxx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
index 372494e82f40..f6b779c12ca7 100644
--- a/drivers/rtc/rtc-pm8xxx.c
+++ b/drivers/rtc/rtc-pm8xxx.c
@@ -530,15 +530,14 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int pm8xxx_remove(struct platform_device *pdev)
+static void pm8xxx_remove(struct platform_device *pdev)
 {
 	dev_pm_clear_wake_irq(&pdev->dev);
-	return 0;
 }
 
 static struct platform_driver pm8xxx_rtc_driver = {
 	.probe		= pm8xxx_rtc_probe,
-	.remove		= pm8xxx_remove,
+	.remove_new	= pm8xxx_remove,
 	.driver	= {
 		.name		= "rtc-pm8xxx",
 		.of_match_table	= pm8xxx_id_table,
-- 
2.39.1


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

* [PATCH 26/41] rtc: rc5t583: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (24 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 25/41] rtc: pm8xxx: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 27/41] rtc: rtd119x: " Uwe Kleine-König
                   ` (18 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-rc5t583.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-rc5t583.c b/drivers/rtc/rtc-rc5t583.c
index 18684a7026c4..6f4bf919827a 100644
--- a/drivers/rtc/rtc-rc5t583.c
+++ b/drivers/rtc/rtc-rc5t583.c
@@ -262,12 +262,11 @@ static int rc5t583_rtc_probe(struct platform_device *pdev)
  * Disable rc5t583 RTC interrupts.
  * Sets status flag to free.
  */
-static int rc5t583_rtc_remove(struct platform_device *pdev)
+static void rc5t583_rtc_remove(struct platform_device *pdev)
 {
 	struct rc5t583_rtc *rc5t583_rtc = platform_get_drvdata(pdev);
 
 	rc5t583_rtc_alarm_irq_enable(&rc5t583_rtc->rtc->dev, 0);
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -299,7 +298,7 @@ static SIMPLE_DEV_PM_OPS(rc5t583_rtc_pm_ops, rc5t583_rtc_suspend,
 
 static struct platform_driver rc5t583_rtc_driver = {
 	.probe		= rc5t583_rtc_probe,
-	.remove		= rc5t583_rtc_remove,
+	.remove_new	= rc5t583_rtc_remove,
 	.driver		= {
 		.name	= "rtc-rc5t583",
 		.pm	= &rc5t583_rtc_pm_ops,
-- 
2.39.1


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

* [PATCH 27/41] rtc: rtd119x: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (25 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 26/41] rtc: rc5t583: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 28/41] rtc: rzn1: " Uwe Kleine-König
                   ` (17 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-rtd119x.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-rtd119x.c b/drivers/rtc/rtc-rtd119x.c
index 8f9abd65846c..29662dfd56fe 100644
--- a/drivers/rtc/rtc-rtd119x.c
+++ b/drivers/rtc/rtc-rtd119x.c
@@ -216,7 +216,7 @@ static int rtd119x_rtc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rtd119x_rtc_remove(struct platform_device *pdev)
+static void rtd119x_rtc_remove(struct platform_device *pdev)
 {
 	struct rtd119x_rtc *data = platform_get_drvdata(pdev);
 
@@ -224,13 +224,11 @@ static int rtd119x_rtc_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(data->clk);
 	clk_put(data->clk);
-
-	return 0;
 }
 
 static struct platform_driver rtd119x_rtc_driver = {
 	.probe = rtd119x_rtc_probe,
-	.remove = rtd119x_rtc_remove,
+	.remove_new = rtd119x_rtc_remove,
 	.driver = {
 		.name = "rtd1295-rtc",
 		.of_match_table	= rtd119x_rtc_dt_ids,
-- 
2.39.1


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

* [PATCH 28/41] rtc: rzn1: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (26 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 27/41] rtc: rtd119x: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-06  8:12   ` Miquel Raynal
  2023-03-04 13:30 ` [PATCH 29/41] rtc: s3c: " Uwe Kleine-König
                   ` (16 subsequent siblings)
  44 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Miquel Raynal, Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, linux-renesas-soc, 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/rtc/rtc-rzn1.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c
index 0d36bc50197c..dca736caba85 100644
--- a/drivers/rtc/rtc-rzn1.c
+++ b/drivers/rtc/rtc-rzn1.c
@@ -391,11 +391,9 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int rzn1_rtc_remove(struct platform_device *pdev)
+static void rzn1_rtc_remove(struct platform_device *pdev)
 {
 	pm_runtime_put(&pdev->dev);
-
-	return 0;
 }
 
 static const struct of_device_id rzn1_rtc_of_match[] = {
@@ -406,7 +404,7 @@ MODULE_DEVICE_TABLE(of, rzn1_rtc_of_match);
 
 static struct platform_driver rzn1_rtc_driver = {
 	.probe = rzn1_rtc_probe,
-	.remove = rzn1_rtc_remove,
+	.remove_new = rzn1_rtc_remove,
 	.driver = {
 		.name	= "rzn1-rtc",
 		.of_match_table = rzn1_rtc_of_match,
-- 
2.39.1


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

* [PATCH 29/41] rtc: s3c: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (27 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 28/41] rtc: rzn1: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 30/41] rtc: sa1100: " Uwe Kleine-König
                   ` (15 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-s3c.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 8fc5efde3e0b..70e1a18e5efd 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -385,7 +385,7 @@ static void s3c6410_rtc_disable(struct s3c_rtc *info)
 	writew(con, info->base + S3C2410_RTCCON);
 }
 
-static int s3c_rtc_remove(struct platform_device *pdev)
+static void s3c_rtc_remove(struct platform_device *pdev)
 {
 	struct s3c_rtc *info = platform_get_drvdata(pdev);
 
@@ -394,8 +394,6 @@ static int s3c_rtc_remove(struct platform_device *pdev)
 	if (info->data->needs_src_clk)
 		clk_unprepare(info->rtc_src_clk);
 	clk_unprepare(info->rtc_clk);
-
-	return 0;
 }
 
 static int s3c_rtc_probe(struct platform_device *pdev)
@@ -600,7 +598,7 @@ MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
 
 static struct platform_driver s3c_rtc_driver = {
 	.probe		= s3c_rtc_probe,
-	.remove		= s3c_rtc_remove,
+	.remove_new	= s3c_rtc_remove,
 	.driver		= {
 		.name	= "s3c-rtc",
 		.pm	= &s3c_rtc_pm_ops,
-- 
2.39.1


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

* [PATCH 30/41] rtc: sa1100: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (28 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 29/41] rtc: s3c: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 31/41] rtc: spear: " Uwe Kleine-König
                   ` (14 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-sa1100.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c
index 1250887e4382..0b2cfa8ca05b 100644
--- a/drivers/rtc/rtc-sa1100.c
+++ b/drivers/rtc/rtc-sa1100.c
@@ -297,7 +297,7 @@ static int sa1100_rtc_probe(struct platform_device *pdev)
 	return sa1100_rtc_init(pdev, info);
 }
 
-static int sa1100_rtc_remove(struct platform_device *pdev)
+static void sa1100_rtc_remove(struct platform_device *pdev)
 {
 	struct sa1100_rtc *info = platform_get_drvdata(pdev);
 
@@ -307,8 +307,6 @@ static int sa1100_rtc_remove(struct platform_device *pdev)
 		spin_unlock_irq(&info->lock);
 		clk_disable_unprepare(info->clk);
 	}
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -343,7 +341,7 @@ MODULE_DEVICE_TABLE(of, sa1100_rtc_dt_ids);
 
 static struct platform_driver sa1100_rtc_driver = {
 	.probe		= sa1100_rtc_probe,
-	.remove		= sa1100_rtc_remove,
+	.remove_new	= sa1100_rtc_remove,
 	.driver		= {
 		.name	= "sa1100-rtc",
 		.pm	= &sa1100_rtc_pm_ops,
-- 
2.39.1


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

* [PATCH 31/41] rtc: spear: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (29 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 30/41] rtc: sa1100: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 32/41] rtc: stm32: " Uwe Kleine-König
                   ` (13 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-spear.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c
index 736fe535cd45..1df5c7e94198 100644
--- a/drivers/rtc/rtc-spear.c
+++ b/drivers/rtc/rtc-spear.c
@@ -405,15 +405,13 @@ static int spear_rtc_probe(struct platform_device *pdev)
 	return status;
 }
 
-static int spear_rtc_remove(struct platform_device *pdev)
+static void spear_rtc_remove(struct platform_device *pdev)
 {
 	struct spear_rtc_config *config = platform_get_drvdata(pdev);
 
 	spear_rtc_disable_interrupt(config);
 	clk_disable_unprepare(config->clk);
 	device_init_wakeup(&pdev->dev, 0);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -477,7 +475,7 @@ MODULE_DEVICE_TABLE(of, spear_rtc_id_table);
 
 static struct platform_driver spear_rtc_driver = {
 	.probe = spear_rtc_probe,
-	.remove = spear_rtc_remove,
+	.remove_new = spear_rtc_remove,
 	.shutdown = spear_rtc_shutdown,
 	.driver = {
 		.name = "rtc-spear",
-- 
2.39.1


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

* [PATCH 32/41] rtc: stm32: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (30 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 31/41] rtc: spear: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 33/41] rtc: stmp3xxx: " Uwe Kleine-König
                   ` (12 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Maxime Coquelin, Alexandre Torgue
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, 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/rtc/rtc-stm32.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
index ac9e228b56d0..229cb2847cc4 100644
--- a/drivers/rtc/rtc-stm32.c
+++ b/drivers/rtc/rtc-stm32.c
@@ -846,7 +846,7 @@ static int stm32_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int stm32_rtc_remove(struct platform_device *pdev)
+static void stm32_rtc_remove(struct platform_device *pdev)
 {
 	struct stm32_rtc *rtc = platform_get_drvdata(pdev);
 	const struct stm32_rtc_registers *regs = &rtc->data->regs;
@@ -869,8 +869,6 @@ static int stm32_rtc_remove(struct platform_device *pdev)
 
 	dev_pm_clear_wake_irq(&pdev->dev);
 	device_init_wakeup(&pdev->dev, false);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -917,7 +915,7 @@ static SIMPLE_DEV_PM_OPS(stm32_rtc_pm_ops,
 
 static struct platform_driver stm32_rtc_driver = {
 	.probe		= stm32_rtc_probe,
-	.remove		= stm32_rtc_remove,
+	.remove_new	= stm32_rtc_remove,
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.pm	= &stm32_rtc_pm_ops,
-- 
2.39.1


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

* [PATCH 33/41] rtc: stmp3xxx: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (31 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 32/41] rtc: stm32: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 34/41] rtc: sunplus: " Uwe Kleine-König
                   ` (11 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Maxime Coquelin, Alexandre Torgue
  Cc: linux-rtc, linux-stm32, linux-arm-kernel, 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/rtc/rtc-stmp3xxx.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/rtc/rtc-stmp3xxx.c b/drivers/rtc/rtc-stmp3xxx.c
index aae40d20d086..6f11b745f34d 100644
--- a/drivers/rtc/rtc-stmp3xxx.c
+++ b/drivers/rtc/rtc-stmp3xxx.c
@@ -232,17 +232,15 @@ static const struct rtc_class_ops stmp3xxx_rtc_ops = {
 	.set_alarm	= stmp3xxx_rtc_set_alarm,
 };
 
-static int stmp3xxx_rtc_remove(struct platform_device *pdev)
+static void stmp3xxx_rtc_remove(struct platform_device *pdev)
 {
 	struct stmp3xxx_rtc_data *rtc_data = platform_get_drvdata(pdev);
 
 	if (!rtc_data)
-		return 0;
+		return;
 
 	writel(STMP3XXX_RTC_CTRL_ALARM_IRQ_EN,
 		rtc_data->io + STMP3XXX_RTC_CTRL + STMP_OFFSET_REG_CLR);
-
-	return 0;
 }
 
 static int stmp3xxx_rtc_probe(struct platform_device *pdev)
@@ -406,7 +404,7 @@ MODULE_DEVICE_TABLE(of, rtc_dt_ids);
 
 static struct platform_driver stmp3xxx_rtcdrv = {
 	.probe		= stmp3xxx_rtc_probe,
-	.remove		= stmp3xxx_rtc_remove,
+	.remove_new	= stmp3xxx_rtc_remove,
 	.driver		= {
 		.name	= "stmp3xxx-rtc",
 		.pm	= &stmp3xxx_rtc_pm_ops,
-- 
2.39.1


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

* [PATCH 34/41] rtc: sunplus: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (32 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 33/41] rtc: stmp3xxx: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 35/41] rtc: tegra: " Uwe Kleine-König
                   ` (10 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Vincent Shih, Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-sunplus.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-sunplus.c b/drivers/rtc/rtc-sunplus.c
index 4b578e4d44f6..44b8083603c2 100644
--- a/drivers/rtc/rtc-sunplus.c
+++ b/drivers/rtc/rtc-sunplus.c
@@ -304,15 +304,13 @@ static int sp_rtc_probe(struct platform_device *plat_dev)
 	return ret;
 }
 
-static int sp_rtc_remove(struct platform_device *plat_dev)
+static void sp_rtc_remove(struct platform_device *plat_dev)
 {
 	struct sunplus_rtc *sp_rtc = dev_get_drvdata(&plat_dev->dev);
 
 	device_init_wakeup(&plat_dev->dev, 0);
 	reset_control_assert(sp_rtc->rstc);
 	clk_disable_unprepare(sp_rtc->rtcclk);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -347,7 +345,7 @@ static SIMPLE_DEV_PM_OPS(sp_rtc_pm_ops, sp_rtc_suspend, sp_rtc_resume);
 
 static struct platform_driver sp_rtc_driver = {
 	.probe   = sp_rtc_probe,
-	.remove  = sp_rtc_remove,
+	.remove_new = sp_rtc_remove,
 	.driver  = {
 		.name	= "sp7021-rtc",
 		.of_match_table = sp_rtc_of_match,
-- 
2.39.1


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

* [PATCH 35/41] rtc: tegra: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (33 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 34/41] rtc: sunplus: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 36/41] rtc: tps6586x: " Uwe Kleine-König
                   ` (9 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Thierry Reding, Jonathan Hunter
  Cc: linux-rtc, linux-tegra, 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/rtc/rtc-tegra.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index 85f7ad5d5390..441e0a66b215 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -342,13 +342,11 @@ static int tegra_rtc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tegra_rtc_remove(struct platform_device *pdev)
+static void tegra_rtc_remove(struct platform_device *pdev)
 {
 	struct tegra_rtc_info *info = platform_get_drvdata(pdev);
 
 	clk_disable_unprepare(info->clk);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -401,7 +399,7 @@ static void tegra_rtc_shutdown(struct platform_device *pdev)
 
 static struct platform_driver tegra_rtc_driver = {
 	.probe = tegra_rtc_probe,
-	.remove = tegra_rtc_remove,
+	.remove_new = tegra_rtc_remove,
 	.shutdown = tegra_rtc_shutdown,
 	.driver = {
 		.name = "tegra_rtc",
-- 
2.39.1


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

* [PATCH 36/41] rtc: tps6586x: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (34 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 35/41] rtc: tegra: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 37/41] rtc: twl: " Uwe Kleine-König
                   ` (8 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-tps6586x.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c
index 52093e7ba22d..9f14e2475747 100644
--- a/drivers/rtc/rtc-tps6586x.c
+++ b/drivers/rtc/rtc-tps6586x.c
@@ -279,13 +279,12 @@ static int tps6586x_rtc_probe(struct platform_device *pdev)
 	return ret;
 };
 
-static int tps6586x_rtc_remove(struct platform_device *pdev)
+static void tps6586x_rtc_remove(struct platform_device *pdev)
 {
 	struct device *tps_dev = to_tps6586x_dev(&pdev->dev);
 
 	tps6586x_update(tps_dev, RTC_CTRL, 0,
 		RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK);
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -317,7 +316,7 @@ static struct platform_driver tps6586x_rtc_driver = {
 		.pm	= &tps6586x_pm_ops,
 	},
 	.probe	= tps6586x_rtc_probe,
-	.remove	= tps6586x_rtc_remove,
+	.remove_new = tps6586x_rtc_remove,
 };
 module_platform_driver(tps6586x_rtc_driver);
 
-- 
2.39.1


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

* [PATCH 37/41] rtc: twl: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (35 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 36/41] rtc: tps6586x: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 38/41] rtc: vt8500: " Uwe Kleine-König
                   ` (7 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-twl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index c24d1e18f56c..81b36948c2fa 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -586,7 +586,7 @@ static int twl_rtc_probe(struct platform_device *pdev)
  * Disable all TWL RTC module interrupts.
  * Sets status flag to free.
  */
-static int twl_rtc_remove(struct platform_device *pdev)
+static void twl_rtc_remove(struct platform_device *pdev)
 {
 	struct twl_rtc *twl_rtc = platform_get_drvdata(pdev);
 
@@ -599,8 +599,6 @@ static int twl_rtc_remove(struct platform_device *pdev)
 		twl6030_interrupt_mask(TWL6030_RTC_INT_MASK,
 			REG_INT_MSK_STS_A);
 	}
-
-	return 0;
 }
 
 static void twl_rtc_shutdown(struct platform_device *pdev)
@@ -642,7 +640,7 @@ MODULE_DEVICE_TABLE(of, twl_rtc_of_match);
 
 static struct platform_driver twl4030rtc_driver = {
 	.probe		= twl_rtc_probe,
-	.remove		= twl_rtc_remove,
+	.remove_new	= twl_rtc_remove,
 	.shutdown	= twl_rtc_shutdown,
 	.driver		= {
 		.name		= "twl_rtc",
-- 
2.39.1


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

* [PATCH 38/41] rtc: vt8500: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (36 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 37/41] rtc: twl: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 39/41] rtc: wm8350: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-arm-kernel, linux-rtc, 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/rtc/rtc-vt8500.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-vt8500.c b/drivers/rtc/rtc-vt8500.c
index 197b649cd629..ccfa76513a2c 100644
--- a/drivers/rtc/rtc-vt8500.c
+++ b/drivers/rtc/rtc-vt8500.c
@@ -235,14 +235,12 @@ static int vt8500_rtc_probe(struct platform_device *pdev)
 	return devm_rtc_register_device(vt8500_rtc->rtc);
 }
 
-static int vt8500_rtc_remove(struct platform_device *pdev)
+static void vt8500_rtc_remove(struct platform_device *pdev)
 {
 	struct vt8500_rtc *vt8500_rtc = platform_get_drvdata(pdev);
 
 	/* Disable alarm matching */
 	writel(0, vt8500_rtc->regbase + VT8500_RTC_IS);
-
-	return 0;
 }
 
 static const struct of_device_id wmt_dt_ids[] = {
@@ -253,7 +251,7 @@ MODULE_DEVICE_TABLE(of, wmt_dt_ids);
 
 static struct platform_driver vt8500_rtc_driver = {
 	.probe		= vt8500_rtc_probe,
-	.remove		= vt8500_rtc_remove,
+	.remove_new	= vt8500_rtc_remove,
 	.driver		= {
 		.name	= "vt8500-rtc",
 		.of_match_table = wmt_dt_ids,
-- 
2.39.1


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

* [PATCH 39/41] rtc: wm8350: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (37 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 38/41] rtc: vt8500: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-06  9:37   ` Charles Keepax
  2023-03-04 13:30 ` [PATCH 40/41] rtc: xgene: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  44 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: patches, linux-rtc, 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/rtc/rtc-wm8350.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-wm8350.c b/drivers/rtc/rtc-wm8350.c
index 6eaa9321c074..947f8071803f 100644
--- a/drivers/rtc/rtc-wm8350.c
+++ b/drivers/rtc/rtc-wm8350.c
@@ -451,14 +451,12 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int wm8350_rtc_remove(struct platform_device *pdev)
+static void wm8350_rtc_remove(struct platform_device *pdev)
 {
 	struct wm8350 *wm8350 = platform_get_drvdata(pdev);
 
 	wm8350_free_irq(wm8350, WM8350_IRQ_RTC_SEC, wm8350);
 	wm8350_free_irq(wm8350, WM8350_IRQ_RTC_ALM, wm8350);
-
-	return 0;
 }
 
 static SIMPLE_DEV_PM_OPS(wm8350_rtc_pm_ops, wm8350_rtc_suspend,
@@ -466,7 +464,7 @@ static SIMPLE_DEV_PM_OPS(wm8350_rtc_pm_ops, wm8350_rtc_suspend,
 
 static struct platform_driver wm8350_rtc_driver = {
 	.probe = wm8350_rtc_probe,
-	.remove = wm8350_rtc_remove,
+	.remove_new = wm8350_rtc_remove,
 	.driver = {
 		.name = "wm8350-rtc",
 		.pm = &wm8350_rtc_pm_ops,
-- 
2.39.1


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

* [PATCH 40/41] rtc: xgene: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (38 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 39/41] rtc: wm8350: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-04 13:30 ` [PATCH 41/41] rtc: zynqmp: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, 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/rtc/rtc-xgene.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-xgene.c b/drivers/rtc/rtc-xgene.c
index d3d0054e21fd..f78efc9760c0 100644
--- a/drivers/rtc/rtc-xgene.c
+++ b/drivers/rtc/rtc-xgene.c
@@ -192,14 +192,13 @@ static int xgene_rtc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int xgene_rtc_remove(struct platform_device *pdev)
+static void xgene_rtc_remove(struct platform_device *pdev)
 {
 	struct xgene_rtc_dev *pdata = platform_get_drvdata(pdev);
 
 	xgene_rtc_alarm_irq_enable(&pdev->dev, 0);
 	device_init_wakeup(&pdev->dev, 0);
 	clk_disable_unprepare(pdata->clk);
-	return 0;
 }
 
 static int __maybe_unused xgene_rtc_suspend(struct device *dev)
@@ -264,7 +263,7 @@ MODULE_DEVICE_TABLE(of, xgene_rtc_of_match);
 
 static struct platform_driver xgene_rtc_driver = {
 	.probe		= xgene_rtc_probe,
-	.remove		= xgene_rtc_remove,
+	.remove_new	= xgene_rtc_remove,
 	.driver		= {
 		.name	= "xgene-rtc",
 		.pm = &xgene_rtc_pm_ops,
-- 
2.39.1


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

* [PATCH 41/41] rtc: zynqmp: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (39 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 40/41] rtc: xgene: " Uwe Kleine-König
@ 2023-03-04 13:30 ` Uwe Kleine-König
  2023-03-14  9:05 ` [PATCH 00/41] rtc: " Naresh Kamboju
                   ` (3 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-04 13:30 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Michal Simek
  Cc: linux-rtc, linux-arm-kernel, 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/rtc/rtc-zynqmp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c
index c9b85c838ebe..08ed171bdab4 100644
--- a/drivers/rtc/rtc-zynqmp.c
+++ b/drivers/rtc/rtc-zynqmp.c
@@ -342,12 +342,10 @@ static int xlnx_rtc_probe(struct platform_device *pdev)
 	return devm_rtc_register_device(xrtcdev->rtc);
 }
 
-static int xlnx_rtc_remove(struct platform_device *pdev)
+static void xlnx_rtc_remove(struct platform_device *pdev)
 {
 	xlnx_rtc_alarm_irq_enable(&pdev->dev, 0);
 	device_init_wakeup(&pdev->dev, 0);
-
-	return 0;
 }
 
 static int __maybe_unused xlnx_rtc_suspend(struct device *dev)
@@ -384,7 +382,7 @@ MODULE_DEVICE_TABLE(of, xlnx_rtc_of_match);
 
 static struct platform_driver xlnx_rtc_driver = {
 	.probe		= xlnx_rtc_probe,
-	.remove		= xlnx_rtc_remove,
+	.remove_new	= xlnx_rtc_remove,
 	.driver		= {
 		.name	= KBUILD_MODNAME,
 		.pm	= &xlnx_rtc_pm_ops,
-- 
2.39.1


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

* Re: [PATCH 18/41] rtc: mpfs: Convert to platform remove callback returning void
  2023-03-04 13:30 ` [PATCH 18/41] rtc: mpfs: " Uwe Kleine-König
@ 2023-03-04 13:47   ` Conor Dooley
  0 siblings, 0 replies; 61+ messages in thread
From: Conor Dooley @ 2023-03-04 13:47 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Conor Dooley, Daire McNamara, Alessandro Zummo,
	Alexandre Belloni, linux-riscv, linux-rtc, kernel

[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]

On Sat, Mar 04, 2023 at 02:30:05PM +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.
> 
> 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>

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
>  drivers/rtc/rtc-mpfs.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-mpfs.c b/drivers/rtc/rtc-mpfs.c
> index 2a479d44f198..5b96a6d39210 100644
> --- a/drivers/rtc/rtc-mpfs.c
> +++ b/drivers/rtc/rtc-mpfs.c
> @@ -274,11 +274,9 @@ static int mpfs_rtc_probe(struct platform_device *pdev)
>  	return devm_rtc_register_device(rtcdev->rtc);
>  }
>  
> -static int mpfs_rtc_remove(struct platform_device *pdev)
> +static void mpfs_rtc_remove(struct platform_device *pdev)
>  {
>  	dev_pm_clear_wake_irq(&pdev->dev);
> -
> -	return 0;
>  }
>  
>  static const struct of_device_id mpfs_rtc_of_match[] = {
> @@ -290,7 +288,7 @@ MODULE_DEVICE_TABLE(of, mpfs_rtc_of_match);
>  
>  static struct platform_driver mpfs_rtc_driver = {
>  	.probe = mpfs_rtc_probe,
> -	.remove = mpfs_rtc_remove,
> +	.remove_new = mpfs_rtc_remove,
>  	.driver	= {
>  		.name = "mpfs_rtc",
>  		.of_match_table = mpfs_rtc_of_match,
> -- 
> 2.39.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH 15/41] rtc: max77686: Convert to platform remove callback returning void
  2023-03-04 13:30 ` [PATCH 15/41] rtc: max77686: " Uwe Kleine-König
@ 2023-03-05  9:50   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 61+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-05  9:50 UTC (permalink / raw)
  To: Uwe Kleine-König, Chanwoo Choi, Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, kernel

On 04/03/2023 14:30, 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>
> ---
>  drivers/rtc/rtc-max77686.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)


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

Best regards,
Krzysztof


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

* Re: [PATCH 28/41] rtc: rzn1: Convert to platform remove callback returning void
  2023-03-04 13:30 ` [PATCH 28/41] rtc: rzn1: " Uwe Kleine-König
@ 2023-03-06  8:12   ` Miquel Raynal
  0 siblings, 0 replies; 61+ messages in thread
From: Miquel Raynal @ 2023-03-06  8:12 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Alessandro Zummo, Alexandre Belloni, linux-rtc,
	linux-renesas-soc, kernel

Hi Uwe,

u.kleine-koenig@pengutronix.de wrote on Sat,  4 Mar 2023 14:30:15 +0100:

> 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.

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/rtc/rtc-rzn1.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c
> index 0d36bc50197c..dca736caba85 100644
> --- a/drivers/rtc/rtc-rzn1.c
> +++ b/drivers/rtc/rtc-rzn1.c

Thanks,
Miquèl

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

* Re: [PATCH 39/41] rtc: wm8350: Convert to platform remove callback returning void
  2023-03-04 13:30 ` [PATCH 39/41] rtc: wm8350: " Uwe Kleine-König
@ 2023-03-06  9:37   ` Charles Keepax
  0 siblings, 0 replies; 61+ messages in thread
From: Charles Keepax @ 2023-03-06  9:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Alessandro Zummo, Alexandre Belloni, patches, linux-rtc, kernel

On Sat, Mar 04, 2023 at 02:30:26PM +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.
> 
> 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>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH 06/41] rtc: at91sam9: Convert to platform remove callback returning void
  2023-03-04 13:29 ` [PATCH 06/41] rtc: at91sam9: " Uwe Kleine-König
@ 2023-03-06 11:55   ` Claudiu.Beznea
  0 siblings, 0 replies; 61+ messages in thread
From: Claudiu.Beznea @ 2023-03-06 11:55 UTC (permalink / raw)
  To: u.kleine-koenig, a.zummo, alexandre.belloni, Nicolas.Ferre
  Cc: linux-rtc, linux-arm-kernel, kernel

On 04.03.2023 15:29, Uwe Kleine-König wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> 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>

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>


> ---
>  drivers/rtc/rtc-at91sam9.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
> index b7b5ea1a4e67..610f27dfc462 100644
> --- a/drivers/rtc/rtc-at91sam9.c
> +++ b/drivers/rtc/rtc-at91sam9.c
> @@ -442,7 +442,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
>  /*
>   * Disable and remove the RTC driver
>   */
> -static int at91_rtc_remove(struct platform_device *pdev)
> +static void at91_rtc_remove(struct platform_device *pdev)
>  {
>         struct sam9_rtc *rtc = platform_get_drvdata(pdev);
>         u32             mr = rtt_readl(rtc, MR);
> @@ -451,8 +451,6 @@ static int at91_rtc_remove(struct platform_device *pdev)
>         rtt_writel(rtc, MR, mr & ~(AT91_RTT_ALMIEN | AT91_RTT_RTTINCIEN));
> 
>         clk_disable_unprepare(rtc->sclk);
> -
> -       return 0;
>  }
> 
>  static void at91_rtc_shutdown(struct platform_device *pdev)
> @@ -531,7 +529,7 @@ MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids);
> 
>  static struct platform_driver at91_rtc_driver = {
>         .probe          = at91_rtc_probe,
> -       .remove         = at91_rtc_remove,
> +       .remove_new     = at91_rtc_remove,
>         .shutdown       = at91_rtc_shutdown,
>         .driver         = {
>                 .name   = "rtc-at91sam9",
> --
> 2.39.1
> 


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

* Re: [PATCH 11/41] rtc: ds1685: Convert to platform remove callback returning void
  2023-03-04 13:29 ` [PATCH 11/41] rtc: ds1685: " Uwe Kleine-König
@ 2023-03-06 19:43   ` Joshua Kinard
  2023-03-06 21:22     ` Uwe Kleine-König
  0 siblings, 1 reply; 61+ messages in thread
From: Joshua Kinard @ 2023-03-06 19:43 UTC (permalink / raw)
  To: Uwe Kleine-König, Alessandro Zummo, Alexandre Belloni
  Cc: linux-rtc, kernel

On 3/4/2023 08:29, 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>
> ---
>   drivers/rtc/rtc-ds1685.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
> index 5db9c737c022..0f707be0eb87 100644
> --- a/drivers/rtc/rtc-ds1685.c
> +++ b/drivers/rtc/rtc-ds1685.c
> @@ -1322,7 +1322,7 @@ ds1685_rtc_probe(struct platform_device *pdev)
>    * ds1685_rtc_remove - removes rtc driver.
>    * @pdev: pointer to platform_device structure.
>    */
> -static int
> +static void
>   ds1685_rtc_remove(struct platform_device *pdev)
>   {
>   	struct ds1685_priv *rtc = platform_get_drvdata(pdev);
> @@ -1344,8 +1344,6 @@ ds1685_rtc_remove(struct platform_device *pdev)
>   	rtc->write(rtc, RTC_EXT_CTRL_4A,
>   		   (rtc->read(rtc, RTC_EXT_CTRL_4A) &
>   		    ~(RTC_CTRL_4A_RWK_MASK)));
> -
> -	return 0;
>   }
>   
>   /*
> @@ -1356,7 +1354,7 @@ static struct platform_driver ds1685_rtc_driver = {
>   		.name	= "rtc-ds1685",
>   	},
>   	.probe		= ds1685_rtc_probe,
> -	.remove		= ds1685_rtc_remove,
> +	.remove_new	= ds1685_rtc_remove,
>   };
>   module_platform_driver(ds1685_rtc_driver);
>   /* ----------------------------------------------------------------------- */

Is there a future planned patch that would remove the .remove member and then rename .remove_new --> .remove?

-- 
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org
rsa6144/5C63F4E3F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943

"The past tempts us, the present confuses us, the future frightens us.  And our lives slip away, moment by 
moment, lost in that vast, terrible in-between."

         --Emperor Turhan, Centauri Republic


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

* Re: [PATCH 11/41] rtc: ds1685: Convert to platform remove callback returning void
  2023-03-06 19:43   ` Joshua Kinard
@ 2023-03-06 21:22     ` Uwe Kleine-König
  2023-03-07  2:09       ` Joshua Kinard
  0 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-06 21:22 UTC (permalink / raw)
  To: Joshua Kinard; +Cc: Alessandro Zummo, Alexandre Belloni, linux-rtc, kernel

[-- Attachment #1: Type: text/plain, Size: 4426 bytes --]

On Mon, Mar 06, 2023 at 02:43:20PM -0500, Joshua Kinard wrote:
> On 3/4/2023 08:29, 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>
> > ---
> >   drivers/rtc/rtc-ds1685.c | 6 ++----
> >   1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
> > index 5db9c737c022..0f707be0eb87 100644
> > --- a/drivers/rtc/rtc-ds1685.c
> > +++ b/drivers/rtc/rtc-ds1685.c
> > @@ -1322,7 +1322,7 @@ ds1685_rtc_probe(struct platform_device *pdev)
> >    * ds1685_rtc_remove - removes rtc driver.
> >    * @pdev: pointer to platform_device structure.
> >    */
> > -static int
> > +static void
> >   ds1685_rtc_remove(struct platform_device *pdev)
> >   {
> >   	struct ds1685_priv *rtc = platform_get_drvdata(pdev);
> > @@ -1344,8 +1344,6 @@ ds1685_rtc_remove(struct platform_device *pdev)
> >   	rtc->write(rtc, RTC_EXT_CTRL_4A,
> >   		   (rtc->read(rtc, RTC_EXT_CTRL_4A) &
> >   		    ~(RTC_CTRL_4A_RWK_MASK)));
> > -
> > -	return 0;
> >   }
> >   /*
> > @@ -1356,7 +1354,7 @@ static struct platform_driver ds1685_rtc_driver = {
> >   		.name	= "rtc-ds1685",
> >   	},
> >   	.probe		= ds1685_rtc_probe,
> > -	.remove		= ds1685_rtc_remove,
> > +	.remove_new	= ds1685_rtc_remove,
> >   };
> >   module_platform_driver(ds1685_rtc_driver);
> >   /* ----------------------------------------------------------------------- */
> 
> Is there a future planned patch that would remove the .remove member
> and then rename .remove_new --> .remove?

The eventual plan is to do

diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 77510e4f47de..1c65943d6b53 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -1420,14 +1420,8 @@ static void platform_remove(struct device *_dev)
 	struct platform_driver *drv = to_platform_driver(_dev->driver);
 	struct platform_device *dev = to_platform_device(_dev);
 
-	if (drv->remove_new) {
-		drv->remove_new(dev);
-	} else if (drv->remove) {
-		int ret = drv->remove(dev);
-
-		if (ret)
-			dev_warn(_dev, "remove callback returned a non-zero value. This will be ignored.\n");
-	}
+	if (drv->remove)
+		drv->remove(dev);
 	dev_pm_domain_detach(_dev, true);
 }
index b845fd83f429..8c5fdaa8645f 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -209,15 +209,16 @@ struct platform_driver {
 	int (*probe)(struct platform_device *);
 
 	/*
-	 * Traditionally the remove callback returned an int which however is
+	 * Traditionally the remove callback returned an int which however was
 	 * ignored by the driver core. This led to wrong expectations by driver
 	 * authors who thought returning an error code was a valid error
-	 * handling strategy. To convert to a callback returning void, new
-	 * drivers should implement .remove_new() until the conversion it done
-	 * that eventually makes .remove() return void.
+	 * handling strategy. .remove_new is a hangover from these times which
+	 * will be dropped once all drivers are converted to .remove().
 	 */
-	int (*remove)(struct platform_device *);
-	void (*remove_new)(struct platform_device *);
+	union {
+		void (*remove)(struct platform_device *);
+		void (*remove_new)(struct platform_device *);
+	};
 
 	void (*shutdown)(struct platform_device *);
 	int (*suspend)(struct platform_device *, pm_message_t state);

and then once all the drivers are converted back to .remove() drop the
union and .remove_new().

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 11/41] rtc: ds1685: Convert to platform remove callback returning void
  2023-03-06 21:22     ` Uwe Kleine-König
@ 2023-03-07  2:09       ` Joshua Kinard
  2023-03-07  8:11         ` Uwe Kleine-König
  0 siblings, 1 reply; 61+ messages in thread
From: Joshua Kinard @ 2023-03-07  2:09 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Alessandro Zummo, Alexandre Belloni, linux-rtc, kernel

On 3/6/2023 16:22, Uwe Kleine-König wrote:
> On Mon, Mar 06, 2023 at 02:43:20PM -0500, Joshua Kinard wrote:
>> On 3/4/2023 08:29, 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>
>>> ---
>>>    drivers/rtc/rtc-ds1685.c | 6 ++----
>>>    1 file changed, 2 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
>>> index 5db9c737c022..0f707be0eb87 100644
>>> --- a/drivers/rtc/rtc-ds1685.c
>>> +++ b/drivers/rtc/rtc-ds1685.c
>>> @@ -1322,7 +1322,7 @@ ds1685_rtc_probe(struct platform_device *pdev)
>>>     * ds1685_rtc_remove - removes rtc driver.
>>>     * @pdev: pointer to platform_device structure.
>>>     */
>>> -static int
>>> +static void
>>>    ds1685_rtc_remove(struct platform_device *pdev)
>>>    {
>>>    	struct ds1685_priv *rtc = platform_get_drvdata(pdev);
>>> @@ -1344,8 +1344,6 @@ ds1685_rtc_remove(struct platform_device *pdev)
>>>    	rtc->write(rtc, RTC_EXT_CTRL_4A,
>>>    		   (rtc->read(rtc, RTC_EXT_CTRL_4A) &
>>>    		    ~(RTC_CTRL_4A_RWK_MASK)));
>>> -
>>> -	return 0;
>>>    }
>>>    /*
>>> @@ -1356,7 +1354,7 @@ static struct platform_driver ds1685_rtc_driver = {
>>>    		.name	= "rtc-ds1685",
>>>    	},
>>>    	.probe		= ds1685_rtc_probe,
>>> -	.remove		= ds1685_rtc_remove,
>>> +	.remove_new	= ds1685_rtc_remove,
>>>    };
>>>    module_platform_driver(ds1685_rtc_driver);
>>>    /* ----------------------------------------------------------------------- */
>>
>> Is there a future planned patch that would remove the .remove member
>> and then rename .remove_new --> .remove?
> 
> The eventual plan is to do
> 
> diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 77510e4f47de..1c65943d6b53 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -1420,14 +1420,8 @@ static void platform_remove(struct device *_dev)
>   	struct platform_driver *drv = to_platform_driver(_dev->driver);
>   	struct platform_device *dev = to_platform_device(_dev);
>   
> -	if (drv->remove_new) {
> -		drv->remove_new(dev);
> -	} else if (drv->remove) {
> -		int ret = drv->remove(dev);
> -
> -		if (ret)
> -			dev_warn(_dev, "remove callback returned a non-zero value. This will be ignored.\n");
> -	}
> +	if (drv->remove)
> +		drv->remove(dev);
>   	dev_pm_domain_detach(_dev, true);
>   }
> index b845fd83f429..8c5fdaa8645f 100644
> --- a/include/linux/platform_device.h
> +++ b/include/linux/platform_device.h
> @@ -209,15 +209,16 @@ struct platform_driver {
>   	int (*probe)(struct platform_device *);
>   
>   	/*
> -	 * Traditionally the remove callback returned an int which however is
> +	 * Traditionally the remove callback returned an int which however was
>   	 * ignored by the driver core. This led to wrong expectations by driver
>   	 * authors who thought returning an error code was a valid error
> -	 * handling strategy. To convert to a callback returning void, new
> -	 * drivers should implement .remove_new() until the conversion it done
> -	 * that eventually makes .remove() return void.
> +	 * handling strategy. .remove_new is a hangover from these times which
> +	 * will be dropped once all drivers are converted to .remove().
>   	 */
> -	int (*remove)(struct platform_device *);
> -	void (*remove_new)(struct platform_device *);
> +	union {
> +		void (*remove)(struct platform_device *);
> +		void (*remove_new)(struct platform_device *);
> +	};
>   
>   	void (*shutdown)(struct platform_device *);
>   	int (*suspend)(struct platform_device *, pm_message_t state);
> 
> and then once all the drivers are converted back to .remove() drop the
> union and .remove_new().
> 
> Best regards
> Uwe
> 

This looks like a pretty simple/minor API change.  Why not just do a patch series that makes both the API 
change and updates all of the drivers at once (one commit per driver)?  It gets it done and out of the way and 
you don't have to worry about fixing things later on.  I've seen far more intrusive changes done via patch 
series before with little resistance.

-- 
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org
rsa6144/5C63F4E3F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943

"The past tempts us, the present confuses us, the future frightens us.  And our lives slip away, moment by 
moment, lost in that vast, terrible in-between."

         --Emperor Turhan, Centauri Republic


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

* Re: [PATCH 10/41] rtc: cros-ec: Convert to platform remove callback returning void
  2023-03-04 13:29 ` [PATCH 10/41] rtc: cros-ec: " Uwe Kleine-König
@ 2023-03-07  5:30   ` Tzung-Bi Shih
  0 siblings, 0 replies; 61+ messages in thread
From: Tzung-Bi Shih @ 2023-03-07  5:30 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Alessandro Zummo, Alexandre Belloni, Benson Leung, Guenter Roeck,
	linux-rtc, chrome-platform, kernel

On Sat, Mar 04, 2023 at 02:29:57PM +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.
> 
> 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>

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

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

* Re: [PATCH 11/41] rtc: ds1685: Convert to platform remove callback returning void
  2023-03-07  2:09       ` Joshua Kinard
@ 2023-03-07  8:11         ` Uwe Kleine-König
  2023-03-08 16:20           ` Joshua Kinard
  0 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-07  8:11 UTC (permalink / raw)
  To: Joshua Kinard; +Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, kernel

[-- Attachment #1: Type: text/plain, Size: 6265 bytes --]

Hello Joshua,

On Mon, Mar 06, 2023 at 09:09:03PM -0500, Joshua Kinard wrote:
> On 3/6/2023 16:22, Uwe Kleine-König wrote:
> > On Mon, Mar 06, 2023 at 02:43:20PM -0500, Joshua Kinard wrote:
> > > On 3/4/2023 08:29, 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>
> > > > ---
> > > >    drivers/rtc/rtc-ds1685.c | 6 ++----
> > > >    1 file changed, 2 insertions(+), 4 deletions(-)
> > > > 
> > > > diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
> > > > index 5db9c737c022..0f707be0eb87 100644
> > > > --- a/drivers/rtc/rtc-ds1685.c
> > > > +++ b/drivers/rtc/rtc-ds1685.c
> > > > @@ -1322,7 +1322,7 @@ ds1685_rtc_probe(struct platform_device *pdev)
> > > >     * ds1685_rtc_remove - removes rtc driver.
> > > >     * @pdev: pointer to platform_device structure.
> > > >     */
> > > > -static int
> > > > +static void
> > > >    ds1685_rtc_remove(struct platform_device *pdev)
> > > >    {
> > > >    	struct ds1685_priv *rtc = platform_get_drvdata(pdev);
> > > > @@ -1344,8 +1344,6 @@ ds1685_rtc_remove(struct platform_device *pdev)
> > > >    	rtc->write(rtc, RTC_EXT_CTRL_4A,
> > > >    		   (rtc->read(rtc, RTC_EXT_CTRL_4A) &
> > > >    		    ~(RTC_CTRL_4A_RWK_MASK)));
> > > > -
> > > > -	return 0;
> > > >    }
> > > >    /*
> > > > @@ -1356,7 +1354,7 @@ static struct platform_driver ds1685_rtc_driver = {
> > > >    		.name	= "rtc-ds1685",
> > > >    	},
> > > >    	.probe		= ds1685_rtc_probe,
> > > > -	.remove		= ds1685_rtc_remove,
> > > > +	.remove_new	= ds1685_rtc_remove,
> > > >    };
> > > >    module_platform_driver(ds1685_rtc_driver);
> > > >    /* ----------------------------------------------------------------------- */
> > > 
> > > Is there a future planned patch that would remove the .remove member
> > > and then rename .remove_new --> .remove?
> > 
> > The eventual plan is to do
> > 
> > diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
> > diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> > index 77510e4f47de..1c65943d6b53 100644
> > --- a/drivers/base/platform.c
> > +++ b/drivers/base/platform.c
> > @@ -1420,14 +1420,8 @@ static void platform_remove(struct device *_dev)
> >   	struct platform_driver *drv = to_platform_driver(_dev->driver);
> >   	struct platform_device *dev = to_platform_device(_dev);
> > -	if (drv->remove_new) {
> > -		drv->remove_new(dev);
> > -	} else if (drv->remove) {
> > -		int ret = drv->remove(dev);
> > -
> > -		if (ret)
> > -			dev_warn(_dev, "remove callback returned a non-zero value. This will be ignored.\n");
> > -	}
> > +	if (drv->remove)
> > +		drv->remove(dev);
> >   	dev_pm_domain_detach(_dev, true);
> >   }
> > index b845fd83f429..8c5fdaa8645f 100644
> > --- a/include/linux/platform_device.h
> > +++ b/include/linux/platform_device.h
> > @@ -209,15 +209,16 @@ struct platform_driver {
> >   	int (*probe)(struct platform_device *);
> >   	/*
> > -	 * Traditionally the remove callback returned an int which however is
> > +	 * Traditionally the remove callback returned an int which however was
> >   	 * ignored by the driver core. This led to wrong expectations by driver
> >   	 * authors who thought returning an error code was a valid error
> > -	 * handling strategy. To convert to a callback returning void, new
> > -	 * drivers should implement .remove_new() until the conversion it done
> > -	 * that eventually makes .remove() return void.
> > +	 * handling strategy. .remove_new is a hangover from these times which
> > +	 * will be dropped once all drivers are converted to .remove().
> >   	 */
> > -	int (*remove)(struct platform_device *);
> > -	void (*remove_new)(struct platform_device *);
> > +	union {
> > +		void (*remove)(struct platform_device *);
> > +		void (*remove_new)(struct platform_device *);
> > +	};
> >   	void (*shutdown)(struct platform_device *);
> >   	int (*suspend)(struct platform_device *, pm_message_t state);
> > 
> > and then once all the drivers are converted back to .remove() drop the
> > union and .remove_new().
> > 
> > Best regards
> > Uwe
> > 
> 
> This looks like a pretty simple/minor API change.  Why not just do a patch
> series that makes both the API change and updates all of the drivers at once
> (one commit per driver)?

A bit of statistic: Based on v6.3-rc1 I have 2286 patches like the ones
from this series that (mostly) convert drivers that today already return
zero unconditionally. Then there is my todo-list of ~100 additional
drivers that don't return 0 that need manual inspection and fixing.

So we're talking about 2300+ drivers in all subsystems here. To get a
bisectable series that does the complete conversion, we need:

	2300 patches to convert drivers to .remove_new()
	the above patch
	2300 patches to convert drivers back to the new .remove()

Last time I sent a series with ~640 patches (for a similar conversion
for i2c drivers) people were unlucky already and I got tons of bounces.
Please consider the address list for the cover letter. While most
patches are trivial this would require a massive coordination.

So no, this isn't a sensible suggestion. I'll continue to send out
conversions to .remove_new() per subsystem and once most of them are
converted, the above patch will be sent with the remainder of the
unapplied patches.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 03/41] rtc: ab8500: Convert to platform remove callback returning void
  2023-03-04 13:29 ` [PATCH 03/41] rtc: ab8500: " Uwe Kleine-König
@ 2023-03-07 13:35   ` Linus Walleij
  0 siblings, 0 replies; 61+ messages in thread
From: Linus Walleij @ 2023-03-07 13:35 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Alessandro Zummo, Alexandre Belloni, linux-arm-kernel, linux-rtc, kernel

On Sat, Mar 4, 2023 at 2:30 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 12/41] rtc: ftrtc010: Convert to platform remove callback returning void
  2023-03-04 13:29 ` [PATCH 12/41] rtc: ftrtc010: " Uwe Kleine-König
@ 2023-03-07 13:35   ` Linus Walleij
  0 siblings, 0 replies; 61+ messages in thread
From: Linus Walleij @ 2023-03-07 13:35 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Hans Ulli Kroll, Alessandro Zummo, Alexandre Belloni,
	linux-arm-kernel, linux-rtc, kernel

On Sat, Mar 4, 2023 at 2:30 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 11/41] rtc: ds1685: Convert to platform remove callback returning void
  2023-03-07  8:11         ` Uwe Kleine-König
@ 2023-03-08 16:20           ` Joshua Kinard
  2023-03-08 16:47             ` Uwe Kleine-König
  0 siblings, 1 reply; 61+ messages in thread
From: Joshua Kinard @ 2023-03-08 16:20 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, kernel

On 3/7/2023 03:11, Uwe Kleine-König wrote:
> Hello Joshua,
> 
> On Mon, Mar 06, 2023 at 09:09:03PM -0500, Joshua Kinard wrote:
>> On 3/6/2023 16:22, Uwe Kleine-König wrote:
>>> On Mon, Mar 06, 2023 at 02:43:20PM -0500, Joshua Kinard wrote:
>>>> On 3/4/2023 08:29, 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>
>>>>> ---
>>>>>     drivers/rtc/rtc-ds1685.c | 6 ++----
>>>>>     1 file changed, 2 insertions(+), 4 deletions(-)
>>>>>
>>>>> diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
>>>>> index 5db9c737c022..0f707be0eb87 100644
>>>>> --- a/drivers/rtc/rtc-ds1685.c
>>>>> +++ b/drivers/rtc/rtc-ds1685.c
>>>>> @@ -1322,7 +1322,7 @@ ds1685_rtc_probe(struct platform_device *pdev)
>>>>>      * ds1685_rtc_remove - removes rtc driver.
>>>>>      * @pdev: pointer to platform_device structure.
>>>>>      */
>>>>> -static int
>>>>> +static void
>>>>>     ds1685_rtc_remove(struct platform_device *pdev)
>>>>>     {
>>>>>     	struct ds1685_priv *rtc = platform_get_drvdata(pdev);
>>>>> @@ -1344,8 +1344,6 @@ ds1685_rtc_remove(struct platform_device *pdev)
>>>>>     	rtc->write(rtc, RTC_EXT_CTRL_4A,
>>>>>     		   (rtc->read(rtc, RTC_EXT_CTRL_4A) &
>>>>>     		    ~(RTC_CTRL_4A_RWK_MASK)));
>>>>> -
>>>>> -	return 0;
>>>>>     }
>>>>>     /*
>>>>> @@ -1356,7 +1354,7 @@ static struct platform_driver ds1685_rtc_driver = {
>>>>>     		.name	= "rtc-ds1685",
>>>>>     	},
>>>>>     	.probe		= ds1685_rtc_probe,
>>>>> -	.remove		= ds1685_rtc_remove,
>>>>> +	.remove_new	= ds1685_rtc_remove,
>>>>>     };
>>>>>     module_platform_driver(ds1685_rtc_driver);
>>>>>     /* ----------------------------------------------------------------------- */
>>>>
>>>> Is there a future planned patch that would remove the .remove member
>>>> and then rename .remove_new --> .remove?
>>>
>>> The eventual plan is to do
>>>
>>> diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
>>> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
>>> index 77510e4f47de..1c65943d6b53 100644
>>> --- a/drivers/base/platform.c
>>> +++ b/drivers/base/platform.c
>>> @@ -1420,14 +1420,8 @@ static void platform_remove(struct device *_dev)
>>>    	struct platform_driver *drv = to_platform_driver(_dev->driver);
>>>    	struct platform_device *dev = to_platform_device(_dev);
>>> -	if (drv->remove_new) {
>>> -		drv->remove_new(dev);
>>> -	} else if (drv->remove) {
>>> -		int ret = drv->remove(dev);
>>> -
>>> -		if (ret)
>>> -			dev_warn(_dev, "remove callback returned a non-zero value. This will be ignored.\n");
>>> -	}
>>> +	if (drv->remove)
>>> +		drv->remove(dev);
>>>    	dev_pm_domain_detach(_dev, true);
>>>    }
>>> index b845fd83f429..8c5fdaa8645f 100644
>>> --- a/include/linux/platform_device.h
>>> +++ b/include/linux/platform_device.h
>>> @@ -209,15 +209,16 @@ struct platform_driver {
>>>    	int (*probe)(struct platform_device *);
>>>    	/*
>>> -	 * Traditionally the remove callback returned an int which however is
>>> +	 * Traditionally the remove callback returned an int which however was
>>>    	 * ignored by the driver core. This led to wrong expectations by driver
>>>    	 * authors who thought returning an error code was a valid error
>>> -	 * handling strategy. To convert to a callback returning void, new
>>> -	 * drivers should implement .remove_new() until the conversion it done
>>> -	 * that eventually makes .remove() return void.
>>> +	 * handling strategy. .remove_new is a hangover from these times which
>>> +	 * will be dropped once all drivers are converted to .remove().
>>>    	 */
>>> -	int (*remove)(struct platform_device *);
>>> -	void (*remove_new)(struct platform_device *);
>>> +	union {
>>> +		void (*remove)(struct platform_device *);
>>> +		void (*remove_new)(struct platform_device *);
>>> +	};
>>>    	void (*shutdown)(struct platform_device *);
>>>    	int (*suspend)(struct platform_device *, pm_message_t state);
>>>
>>> and then once all the drivers are converted back to .remove() drop the
>>> union and .remove_new().
>>>
>>> Best regards
>>> Uwe
>>>
>>
>> This looks like a pretty simple/minor API change.  Why not just do a patch
>> series that makes both the API change and updates all of the drivers at once
>> (one commit per driver)?
> 
> A bit of statistic: Based on v6.3-rc1 I have 2286 patches like the ones
> from this series that (mostly) convert drivers that today already return
> zero unconditionally. Then there is my todo-list of ~100 additional
> drivers that don't return 0 that need manual inspection and fixing.
> 
> So we're talking about 2300+ drivers in all subsystems here. To get a
> bisectable series that does the complete conversion, we need:
> 
> 	2300 patches to convert drivers to .remove_new()
> 	the above patch
> 	2300 patches to convert drivers back to the new .remove()
> 
> Last time I sent a series with ~640 patches (for a similar conversion
> for i2c drivers) people were unlucky already and I got tons of bounces.
> Please consider the address list for the cover letter. While most
> patches are trivial this would require a massive coordination.
> 
> So no, this isn't a sensible suggestion. I'll continue to send out
> conversions to .remove_new() per subsystem and once most of them are
> converted, the above patch will be sent with the remainder of the
> unapplied patches.
> 
> Best regards
> Uwe

I was actually thinking more along the lines of doing one patch series per subsystem, so for RTC, ~160 
patches, one per rtc-*.c driver making the change to have .remove() be void, plus a patch to adjust the struct 
platform_driver rtc definition itself.  That way you don't have to have that interval period where drivers are 
carrying around the .remove_new() method, cause I've seen instances in the past where such large-scale changes 
could not be completed in a single kernel development cycle.

But it sounds like you've already got a plan worked out, so your call on how you want to handle this.  Thanks 
for the additional clarification!

Acked-By: Joshua Kinard <kumba@gentoo.org>

-- 
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org
rsa6144/5C63F4E3F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943

"The past tempts us, the present confuses us, the future frightens us.  And our lives slip away, moment by 
moment, lost in that vast, terrible in-between."

         --Emperor Turhan, Centauri Republic


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

* Re: [PATCH 11/41] rtc: ds1685: Convert to platform remove callback returning void
  2023-03-08 16:20           ` Joshua Kinard
@ 2023-03-08 16:47             ` Uwe Kleine-König
  2023-03-13 15:08               ` Joshua Kinard
  0 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-08 16:47 UTC (permalink / raw)
  To: Joshua Kinard; +Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, kernel

[-- Attachment #1: Type: text/plain, Size: 8004 bytes --]

Hello Joshua,

On Wed, Mar 08, 2023 at 11:20:34AM -0500, Joshua Kinard wrote:
> On 3/7/2023 03:11, Uwe Kleine-König wrote:
> > On Mon, Mar 06, 2023 at 09:09:03PM -0500, Joshua Kinard wrote:
> > > On 3/6/2023 16:22, Uwe Kleine-König wrote:
> > > > On Mon, Mar 06, 2023 at 02:43:20PM -0500, Joshua Kinard wrote:
> > > > > On 3/4/2023 08:29, 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>
> > > > > > ---
> > > > > >     drivers/rtc/rtc-ds1685.c | 6 ++----
> > > > > >     1 file changed, 2 insertions(+), 4 deletions(-)
> > > > > > 
> > > > > > diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
> > > > > > index 5db9c737c022..0f707be0eb87 100644
> > > > > > --- a/drivers/rtc/rtc-ds1685.c
> > > > > > +++ b/drivers/rtc/rtc-ds1685.c
> > > > > > @@ -1322,7 +1322,7 @@ ds1685_rtc_probe(struct platform_device *pdev)
> > > > > >      * ds1685_rtc_remove - removes rtc driver.
> > > > > >      * @pdev: pointer to platform_device structure.
> > > > > >      */
> > > > > > -static int
> > > > > > +static void
> > > > > >     ds1685_rtc_remove(struct platform_device *pdev)
> > > > > >     {
> > > > > >     	struct ds1685_priv *rtc = platform_get_drvdata(pdev);
> > > > > > @@ -1344,8 +1344,6 @@ ds1685_rtc_remove(struct platform_device *pdev)
> > > > > >     	rtc->write(rtc, RTC_EXT_CTRL_4A,
> > > > > >     		   (rtc->read(rtc, RTC_EXT_CTRL_4A) &
> > > > > >     		    ~(RTC_CTRL_4A_RWK_MASK)));
> > > > > > -
> > > > > > -	return 0;
> > > > > >     }
> > > > > >     /*
> > > > > > @@ -1356,7 +1354,7 @@ static struct platform_driver ds1685_rtc_driver = {
> > > > > >     		.name	= "rtc-ds1685",
> > > > > >     	},
> > > > > >     	.probe		= ds1685_rtc_probe,
> > > > > > -	.remove		= ds1685_rtc_remove,
> > > > > > +	.remove_new	= ds1685_rtc_remove,
> > > > > >     };
> > > > > >     module_platform_driver(ds1685_rtc_driver);
> > > > > >     /* ----------------------------------------------------------------------- */
> > > > > 
> > > > > Is there a future planned patch that would remove the .remove member
> > > > > and then rename .remove_new --> .remove?
> > > > 
> > > > The eventual plan is to do
> > > > 
> > > > diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
> > > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> > > > index 77510e4f47de..1c65943d6b53 100644
> > > > --- a/drivers/base/platform.c
> > > > +++ b/drivers/base/platform.c
> > > > @@ -1420,14 +1420,8 @@ static void platform_remove(struct device *_dev)
> > > >    	struct platform_driver *drv = to_platform_driver(_dev->driver);
> > > >    	struct platform_device *dev = to_platform_device(_dev);
> > > > -	if (drv->remove_new) {
> > > > -		drv->remove_new(dev);
> > > > -	} else if (drv->remove) {
> > > > -		int ret = drv->remove(dev);
> > > > -
> > > > -		if (ret)
> > > > -			dev_warn(_dev, "remove callback returned a non-zero value. This will be ignored.\n");
> > > > -	}
> > > > +	if (drv->remove)
> > > > +		drv->remove(dev);
> > > >    	dev_pm_domain_detach(_dev, true);
> > > >    }
> > > > index b845fd83f429..8c5fdaa8645f 100644
> > > > --- a/include/linux/platform_device.h
> > > > +++ b/include/linux/platform_device.h
> > > > @@ -209,15 +209,16 @@ struct platform_driver {
> > > >    	int (*probe)(struct platform_device *);
> > > >    	/*
> > > > -	 * Traditionally the remove callback returned an int which however is
> > > > +	 * Traditionally the remove callback returned an int which however was
> > > >    	 * ignored by the driver core. This led to wrong expectations by driver
> > > >    	 * authors who thought returning an error code was a valid error
> > > > -	 * handling strategy. To convert to a callback returning void, new
> > > > -	 * drivers should implement .remove_new() until the conversion it done
> > > > -	 * that eventually makes .remove() return void.
> > > > +	 * handling strategy. .remove_new is a hangover from these times which
> > > > +	 * will be dropped once all drivers are converted to .remove().
> > > >    	 */
> > > > -	int (*remove)(struct platform_device *);
> > > > -	void (*remove_new)(struct platform_device *);
> > > > +	union {
> > > > +		void (*remove)(struct platform_device *);
> > > > +		void (*remove_new)(struct platform_device *);
> > > > +	};
> > > >    	void (*shutdown)(struct platform_device *);
> > > >    	int (*suspend)(struct platform_device *, pm_message_t state);
> > > > 
> > > > and then once all the drivers are converted back to .remove() drop the
> > > > union and .remove_new().
> > > > 
> > > > Best regards
> > > > Uwe
> > > > 
> > > 
> > > This looks like a pretty simple/minor API change.  Why not just do a patch
> > > series that makes both the API change and updates all of the drivers at once
> > > (one commit per driver)?
> > 
> > A bit of statistic: Based on v6.3-rc1 I have 2286 patches like the ones
> > from this series that (mostly) convert drivers that today already return
> > zero unconditionally. Then there is my todo-list of ~100 additional
> > drivers that don't return 0 that need manual inspection and fixing.
> > 
> > So we're talking about 2300+ drivers in all subsystems here. To get a
> > bisectable series that does the complete conversion, we need:
> > 
> > 	2300 patches to convert drivers to .remove_new()
> > 	the above patch
> > 	2300 patches to convert drivers back to the new .remove()
> > 
> > Last time I sent a series with ~640 patches (for a similar conversion
> > for i2c drivers) people were unlucky already and I got tons of bounces.
> > Please consider the address list for the cover letter. While most
> > patches are trivial this would require a massive coordination.
> > 
> > So no, this isn't a sensible suggestion. I'll continue to send out
> > conversions to .remove_new() per subsystem and once most of them are
> > converted, the above patch will be sent with the remainder of the
> > unapplied patches.
> 
> I was actually thinking more along the lines of doing one patch series per
> subsystem, so for RTC, ~160 patches, one per rtc-*.c driver making the
> change to have .remove() be void, plus a patch to adjust the struct
> platform_driver rtc definition itself.

The problem is that all subsystems use the same struct platform_driver.
So I cannot change it for rtc and then in the next development cycle for
(say) iio and i2c.

> That way you don't have to have that
> interval period where drivers are carrying around the .remove_new() method,
> cause I've seen instances in the past where such large-scale changes could
> not be completed in a single kernel development cycle.

Different maintainers seem to have different preferences, but most
prefer one patch per driver. And I don't plan to complete the conversion
in a single development cycle.

> But it sounds like you've already got a plan worked out, so your call on how
> you want to handle this.  Thanks for the additional clarification!
> 
> Acked-By: Joshua Kinard <kumba@gentoo.org>

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 11/41] rtc: ds1685: Convert to platform remove callback returning void
  2023-03-08 16:47             ` Uwe Kleine-König
@ 2023-03-13 15:08               ` Joshua Kinard
  0 siblings, 0 replies; 61+ messages in thread
From: Joshua Kinard @ 2023-03-13 15:08 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-rtc, Alessandro Zummo, Alexandre Belloni, kernel

On 3/8/2023 11:47, Uwe Kleine-König wrote:
> Hello Joshua,
> 
> On Wed, Mar 08, 2023 at 11:20:34AM -0500, Joshua Kinard wrote:
>> On 3/7/2023 03:11, Uwe Kleine-König wrote:
>>> On Mon, Mar 06, 2023 at 09:09:03PM -0500, Joshua Kinard wrote:
>>>> On 3/6/2023 16:22, Uwe Kleine-König wrote:
>>>>> On Mon, Mar 06, 2023 at 02:43:20PM -0500, Joshua Kinard wrote:
>>>>>> On 3/4/2023 08:29, 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>
>>>>>>> ---
>>>>>>>      drivers/rtc/rtc-ds1685.c | 6 ++----
>>>>>>>      1 file changed, 2 insertions(+), 4 deletions(-)
>>>>>>>
>>>>>>> diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
>>>>>>> index 5db9c737c022..0f707be0eb87 100644
>>>>>>> --- a/drivers/rtc/rtc-ds1685.c
>>>>>>> +++ b/drivers/rtc/rtc-ds1685.c
>>>>>>> @@ -1322,7 +1322,7 @@ ds1685_rtc_probe(struct platform_device *pdev)
>>>>>>>       * ds1685_rtc_remove - removes rtc driver.
>>>>>>>       * @pdev: pointer to platform_device structure.
>>>>>>>       */
>>>>>>> -static int
>>>>>>> +static void
>>>>>>>      ds1685_rtc_remove(struct platform_device *pdev)
>>>>>>>      {
>>>>>>>      	struct ds1685_priv *rtc = platform_get_drvdata(pdev);
>>>>>>> @@ -1344,8 +1344,6 @@ ds1685_rtc_remove(struct platform_device *pdev)
>>>>>>>      	rtc->write(rtc, RTC_EXT_CTRL_4A,
>>>>>>>      		   (rtc->read(rtc, RTC_EXT_CTRL_4A) &
>>>>>>>      		    ~(RTC_CTRL_4A_RWK_MASK)));
>>>>>>> -
>>>>>>> -	return 0;
>>>>>>>      }
>>>>>>>      /*
>>>>>>> @@ -1356,7 +1354,7 @@ static struct platform_driver ds1685_rtc_driver = {
>>>>>>>      		.name	= "rtc-ds1685",
>>>>>>>      	},
>>>>>>>      	.probe		= ds1685_rtc_probe,
>>>>>>> -	.remove		= ds1685_rtc_remove,
>>>>>>> +	.remove_new	= ds1685_rtc_remove,
>>>>>>>      };
>>>>>>>      module_platform_driver(ds1685_rtc_driver);
>>>>>>>      /* ----------------------------------------------------------------------- */
>>>>>>
>>>>>> Is there a future planned patch that would remove the .remove member
>>>>>> and then rename .remove_new --> .remove?
>>>>>
>>>>> The eventual plan is to do
>>>>>
>>>>> diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
>>>>> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
>>>>> index 77510e4f47de..1c65943d6b53 100644
>>>>> --- a/drivers/base/platform.c
>>>>> +++ b/drivers/base/platform.c
>>>>> @@ -1420,14 +1420,8 @@ static void platform_remove(struct device *_dev)
>>>>>     	struct platform_driver *drv = to_platform_driver(_dev->driver);
>>>>>     	struct platform_device *dev = to_platform_device(_dev);
>>>>> -	if (drv->remove_new) {
>>>>> -		drv->remove_new(dev);
>>>>> -	} else if (drv->remove) {
>>>>> -		int ret = drv->remove(dev);
>>>>> -
>>>>> -		if (ret)
>>>>> -			dev_warn(_dev, "remove callback returned a non-zero value. This will be ignored.\n");
>>>>> -	}
>>>>> +	if (drv->remove)
>>>>> +		drv->remove(dev);
>>>>>     	dev_pm_domain_detach(_dev, true);
>>>>>     }
>>>>> index b845fd83f429..8c5fdaa8645f 100644
>>>>> --- a/include/linux/platform_device.h
>>>>> +++ b/include/linux/platform_device.h
>>>>> @@ -209,15 +209,16 @@ struct platform_driver {
>>>>>     	int (*probe)(struct platform_device *);
>>>>>     	/*
>>>>> -	 * Traditionally the remove callback returned an int which however is
>>>>> +	 * Traditionally the remove callback returned an int which however was
>>>>>     	 * ignored by the driver core. This led to wrong expectations by driver
>>>>>     	 * authors who thought returning an error code was a valid error
>>>>> -	 * handling strategy. To convert to a callback returning void, new
>>>>> -	 * drivers should implement .remove_new() until the conversion it done
>>>>> -	 * that eventually makes .remove() return void.
>>>>> +	 * handling strategy. .remove_new is a hangover from these times which
>>>>> +	 * will be dropped once all drivers are converted to .remove().
>>>>>     	 */
>>>>> -	int (*remove)(struct platform_device *);
>>>>> -	void (*remove_new)(struct platform_device *);
>>>>> +	union {
>>>>> +		void (*remove)(struct platform_device *);
>>>>> +		void (*remove_new)(struct platform_device *);
>>>>> +	};
>>>>>     	void (*shutdown)(struct platform_device *);
>>>>>     	int (*suspend)(struct platform_device *, pm_message_t state);
>>>>>
>>>>> and then once all the drivers are converted back to .remove() drop the
>>>>> union and .remove_new().
>>>>>
>>>>> Best regards
>>>>> Uwe
>>>>>
>>>>
>>>> This looks like a pretty simple/minor API change.  Why not just do a patch
>>>> series that makes both the API change and updates all of the drivers at once
>>>> (one commit per driver)?
>>>
>>> A bit of statistic: Based on v6.3-rc1 I have 2286 patches like the ones
>>> from this series that (mostly) convert drivers that today already return
>>> zero unconditionally. Then there is my todo-list of ~100 additional
>>> drivers that don't return 0 that need manual inspection and fixing.
>>>
>>> So we're talking about 2300+ drivers in all subsystems here. To get a
>>> bisectable series that does the complete conversion, we need:
>>>
>>> 	2300 patches to convert drivers to .remove_new()
>>> 	the above patch
>>> 	2300 patches to convert drivers back to the new .remove()
>>>
>>> Last time I sent a series with ~640 patches (for a similar conversion
>>> for i2c drivers) people were unlucky already and I got tons of bounces.
>>> Please consider the address list for the cover letter. While most
>>> patches are trivial this would require a massive coordination.
>>>
>>> So no, this isn't a sensible suggestion. I'll continue to send out
>>> conversions to .remove_new() per subsystem and once most of them are
>>> converted, the above patch will be sent with the remainder of the
>>> unapplied patches.
>>
>> I was actually thinking more along the lines of doing one patch series per
>> subsystem, so for RTC, ~160 patches, one per rtc-*.c driver making the
>> change to have .remove() be void, plus a patch to adjust the struct
>> platform_driver rtc definition itself.
> 
> The problem is that all subsystems use the same struct platform_driver.
> So I cannot change it for rtc and then in the next development cycle for
> (say) iio and i2c.
> 

Hah, you're right!  Sorry, I was thinking more classic OOP and thought that the rtc base API had a derived 
struct from platform_driver that allowed for a more precise patch series to be applied.  I know some 
subsystems do have this, but not rtc, so yes, your approach does make more sense now.


>> That way you don't have to have that
>> interval period where drivers are carrying around the .remove_new() method,
>> cause I've seen instances in the past where such large-scale changes could
>> not be completed in a single kernel development cycle.
> 
> Different maintainers seem to have different preferences, but most
> prefer one patch per driver. And I don't plan to complete the conversion
> in a single development cycle.
> 
>> But it sounds like you've already got a plan worked out, so your call on how
>> you want to handle this.  Thanks for the additional clarification!
>>
>> Acked-By: Joshua Kinard <kumba@gentoo.org>
> 
> Thanks
> Uwe
> 

-- 
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org
rsa6144/5C63F4E3F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943

"The past tempts us, the present confuses us, the future frightens us.  And our lives slip away, moment by 
moment, lost in that vast, terrible in-between."

         --Emperor Turhan, Centauri Republic


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

* [PATCH 00/41] rtc: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (40 preceding siblings ...)
  2023-03-04 13:30 ` [PATCH 41/41] rtc: zynqmp: " Uwe Kleine-König
@ 2023-03-14  9:05 ` Naresh Kamboju
  2023-03-17 22:09 ` Alexandre Belloni
                   ` (2 subsequent siblings)
  44 siblings, 0 replies; 61+ messages in thread
From: Naresh Kamboju @ 2023-03-14  9:05 UTC (permalink / raw)
  To: u.kleine-koenig
  Cc: a.zummo, alexandre.belloni, alexandre.torgue,
	angelogioacchino.delregno, bcm-kernel-feedback-list, bleung,
	chrome-platform, claudiu.beznea, conor.dooley, cw00.choi,
	daire.mcnamara, eddie.huang, f.fainelli, groeck, jonathanh,
	kernel, krzysztof.kozlowski, kumba, linus.walleij,
	linux-arm-kernel, linux-mediatek, linux-renesas-soc, linux-riscv,
	linux-rtc, linux-stm32, linux-tegra, matthias.bgg,
	mcoquelin.stm32, michal.simek, miquel.raynal, nicolas.ferre,
	patches, sean.wang, thierry.reding, ulli.kroll, vincent.sunplus,
	vz, Linux Kernel Functional Testing

> Hello,
> 
> this patch series adapts the platform drivers below drivers/rtc 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.

This patch set applied on top of Linux next.

Build tested with gcc-12, clang-16 and clang nightly.
Boot and LTP smoketests performed on
 - qemu-x86_64
 - qemu-arm64
 - fvp-aemva
 - qemu-armv7
 - qemu-i386

Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>

Link,
https://qa-reports.linaro.org/~anders.roxell/linux-mainline-patches/build/lore_kernel_org_linux-arm-kernel_20230304133028_2135435-1-u_kleine-koenig_pengutronix_de/?failures_only=false#!#test-results

--
Linaro LKFT
https://lkft.linaro.org

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

* Re: [PATCH 00/41] rtc: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (41 preceding siblings ...)
  2023-03-14  9:05 ` [PATCH 00/41] rtc: " Naresh Kamboju
@ 2023-03-17 22:09 ` Alexandre Belloni
  2023-05-08  3:45 ` patchwork-bot+chrome-platform
  2023-05-08  3:56 ` patchwork-bot+chrome-platform
  44 siblings, 0 replies; 61+ messages in thread
From: Alexandre Belloni @ 2023-03-17 22:09 UTC (permalink / raw)
  To: Alessandro Zummo, Linus Walleij, Nicolas Ferre, Claudiu Beznea,
	Florian Fainelli, Benson Leung, Joshua Kinard, Hans Ulli Kroll,
	Vladimir Zapolskiy, Chanwoo Choi, Krzysztof Kozlowski,
	Conor Dooley, Daire McNamara, Eddie Huang, Sean Wang,
	Matthias Brugger, Miquel Raynal, Maxime Coquelin,
	Alexandre Torgue, Vincent Shih, Thierry Reding, Jonathan Hunter,
	Michal Simek, Uwe Kleine-König
  Cc: linux-rtc, linux-arm-kernel,
	Broadcom internal kernel review list, Guenter Roeck,
	chrome-platform, linux-riscv, AngeloGioacchino Del Regno,
	linux-mediatek, linux-renesas-soc, linux-stm32, linux-tegra,
	patches, kernel


On Sat, 04 Mar 2023 14:29:47 +0100, Uwe Kleine-König wrote:
> this patch series adapts the platform drivers below drivers/rtc 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!

[01/41] rtc: 88pm80x: Convert to platform remove callback returning void
        commit: 8ef70a5ef3ed41ce4d700794d45fd9e084460a00
[02/41] rtc: 88pm860x: Convert to platform remove callback returning void
        commit: 8fbff75e2b7582fc03dbcd13e67831fb75345dcb
[03/41] rtc: ab8500: Convert to platform remove callback returning void
        commit: 8a700af1babfc0e5d34bd95264d65ea6adb0b288
[04/41] rtc: ac100: Convert to platform remove callback returning void
        commit: 28015e799ad9ff04d68107b7392a4884accedb0e
[05/41] rtc: asm9260: Convert to platform remove callback returning void
        commit: ad01bf83bfc33c53079415f02e160bf72221d7e6
[06/41] rtc: at91sam9: Convert to platform remove callback returning void
        commit: 06e5e4a5a996aefb5d8e0c8db05b014e3bd91a28
[07/41] rtc: brcmstb-waketimer: Convert to platform remove callback returning void
        commit: d64906b320ce6fef446ea72c6043bbec19f0da60
[08/41] rtc: cadence: Convert to platform remove callback returning void
        commit: 0b9efd82a63b31c7c2ce17a3d8ad3aeb28b3a928
[09/41] rtc: cmos: Convert to platform remove callback returning void
        commit: 63c18a079bbb5f564b30e0fa7ec292eb123b1bf6
[10/41] rtc: cros-ec: Convert to platform remove callback returning void
        commit: 0d8742e61098b422b1ba1458a7ce80c4f1e299bb
[11/41] rtc: ds1685: Convert to platform remove callback returning void
        commit: de11783c9d2a4dec9e0e2c01b9a9897d72019d5f
[12/41] rtc: ftrtc010: Convert to platform remove callback returning void
        commit: 43eeb707afb00579a7bb611d14fc9a056bba849e
[13/41] rtc: hid-sensor-time: Convert to platform remove callback returning void
        commit: 30d5365c8dda63e31fb1fbbec446d72d0f1e5ce6
[14/41] rtc: lpc24xx: Convert to platform remove callback returning void
        commit: 52fcb90d8cdf117ade871b01861b8a8defbf3b78
[15/41] rtc: max77686: Convert to platform remove callback returning void
        commit: bf05de01160d493d53cc289be1b1092c26b378b4
[16/41] rtc: mc13xxx: Convert to platform remove callback returning void
        commit: 99c3a1367db02b6b57be54bf61da051a93e0615f
[17/41] rtc: mpc5121: Convert to platform remove callback returning void
        commit: 22edbc10a514a8cf56d9c8da5cc1a2d43e6832a5
[18/41] rtc: mpfs: Convert to platform remove callback returning void
        commit: fa147083acf61de306e2881d91401d817de11093
[19/41] rtc: mt7622: Convert to platform remove callback returning void
        commit: ae0ac71651c726c2f1d5af752d38bf40526b7026
[20/41] rtc: mxc_v2: Convert to platform remove callback returning void
        commit: 153f56f9ce99495ca4cb6d7f2047c29940aef9f5
[21/41] rtc: omap: Convert to platform remove callback returning void
        commit: 578afdb9084ed0446060d627e7f3ecd1c4100c3d
[22/41] rtc: palmas: Convert to platform remove callback returning void
        commit: a7f9864e4362e07e113517d647c5bc355cdee970
[23/41] rtc: pcf50633: Convert to platform remove callback returning void
        commit: d25f0ba97692b4a8ac63bbd2c562741525c5f5ca
[24/41] rtc: pic32: Convert to platform remove callback returning void
        commit: c3d12a10922dcf32a97d3c71f6a574529b061caf
[25/41] rtc: pm8xxx: Convert to platform remove callback returning void
        commit: 3fc5029a8f7d0d3c039c3649e82cc2e4eeeb46a6
[26/41] rtc: rc5t583: Convert to platform remove callback returning void
        commit: ade527dd2192ddabbd4926338c31ca281098c34c
[27/41] rtc: rtd119x: Convert to platform remove callback returning void
        commit: 0824a15b6863a19c7c8e1c16abf6090fd8ac615f
[28/41] rtc: rzn1: Convert to platform remove callback returning void
        commit: e55fbc80e9d2bf3ec0ec77551baa683f30e85b74
[29/41] rtc: s3c: Convert to platform remove callback returning void
        commit: 9e6a2ad120fa3f785f013e70ae7d872abafb8318
[30/41] rtc: sa1100: Convert to platform remove callback returning void
        commit: cf407e9f1a9dc290e2088c11bd0e5542334e7ab4
[31/41] rtc: spear: Convert to platform remove callback returning void
        commit: 25ffc856b3cb1bd08a8645839aa38505469a6edd
[32/41] rtc: stm32: Convert to platform remove callback returning void
        commit: 54c2cb2797cd76465dae08cd9b81676ffad36b27
[33/41] rtc: stmp3xxx: Convert to platform remove callback returning void
        commit: 16324165ab1f90fa06294679e3de58cb53c0423f
[34/41] rtc: sunplus: Convert to platform remove callback returning void
        commit: d6f525040eef1562327fccc4412acdb4f173e01b
[35/41] rtc: tegra: Convert to platform remove callback returning void
        commit: 31c94505f44b47493d62c0fd43d30838326d345f
[36/41] rtc: tps6586x: Convert to platform remove callback returning void
        commit: adebcc1c1916188c1c9ac8e8f54123b07431baf7
[37/41] rtc: twl: Convert to platform remove callback returning void
        commit: fff118c9e8331b9b08b69841498fbea34693a28c
[38/41] rtc: vt8500: Convert to platform remove callback returning void
        commit: 5b1064441f20fc3f397239599b1193fecb7a90e4
[39/41] rtc: wm8350: Convert to platform remove callback returning void
        commit: 631aa2d919f542373892d5ef6baf13e2969a10fd
[40/41] rtc: xgene: Convert to platform remove callback returning void
        commit: 257062d2679f4db5b6ebc9f4e6a77d0a45977278
[41/41] rtc: zynqmp: Convert to platform remove callback returning void
        commit: f45e5cfa73f445fa3cfbb7ebac3a7e2c66a9281c

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 00/41] rtc: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (42 preceding siblings ...)
  2023-03-17 22:09 ` Alexandre Belloni
@ 2023-05-08  3:45 ` patchwork-bot+chrome-platform
  2023-05-08  3:56 ` patchwork-bot+chrome-platform
  44 siblings, 0 replies; 61+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-05-08  3:45 UTC (permalink / raw)
  To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
  Cc: a.zummo, alexandre.belloni, linus.walleij, nicolas.ferre,
	claudiu.beznea, f.fainelli, bleung, kumba, ulli.kroll, vz,
	cw00.choi, krzysztof.kozlowski, conor.dooley, daire.mcnamara,
	eddie.huang, sean.wang, matthias.bgg, miquel.raynal,
	mcoquelin.stm32, alexandre.torgue, vincent.sunplus,
	thierry.reding, jonathanh, michal.simek, linux-rtc,
	linux-arm-kernel, bcm-kernel-feedback-list, groeck,
	chrome-platform, linux-riscv, angelogioacchino.delregno,
	linux-mediatek, linux-renesas-soc, linux-stm32, linux-tegra,
	patches, kernel

Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci)
by Alexandre Belloni <alexandre.belloni@bootlin.com>:

On Sat,  4 Mar 2023 14:29:47 +0100 you wrote:
> Hello,
> 
> this patch series adapts the platform drivers below drivers/rtc 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.
> 
> [...]

Here is the summary with links:
  - [10/41] rtc: cros-ec: Convert to platform remove callback returning void
    https://git.kernel.org/chrome-platform/c/0d8742e61098

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH 00/41] rtc: Convert to platform remove callback returning void
  2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (43 preceding siblings ...)
  2023-05-08  3:45 ` patchwork-bot+chrome-platform
@ 2023-05-08  3:56 ` patchwork-bot+chrome-platform
  44 siblings, 0 replies; 61+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-05-08  3:56 UTC (permalink / raw)
  To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
  Cc: a.zummo, alexandre.belloni, linus.walleij, nicolas.ferre,
	claudiu.beznea, f.fainelli, bleung, kumba, ulli.kroll, vz,
	cw00.choi, krzysztof.kozlowski, conor.dooley, daire.mcnamara,
	eddie.huang, sean.wang, matthias.bgg, miquel.raynal,
	mcoquelin.stm32, alexandre.torgue, vincent.sunplus,
	thierry.reding, jonathanh, michal.simek, linux-rtc,
	linux-arm-kernel, bcm-kernel-feedback-list, groeck,
	chrome-platform, linux-riscv, angelogioacchino.delregno,
	linux-mediatek, linux-renesas-soc, linux-stm32, linux-tegra,
	patches, kernel

Hello:

This patch was applied to chrome-platform/linux.git (for-next)
by Alexandre Belloni <alexandre.belloni@bootlin.com>:

On Sat,  4 Mar 2023 14:29:47 +0100 you wrote:
> Hello,
> 
> this patch series adapts the platform drivers below drivers/rtc 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.
> 
> [...]

Here is the summary with links:
  - [10/41] rtc: cros-ec: Convert to platform remove callback returning void
    https://git.kernel.org/chrome-platform/c/0d8742e61098

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-05-08  3:56 UTC | newest]

Thread overview: 61+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-04 13:29 [PATCH 00/41] rtc: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-04 13:29 ` [PATCH 01/41] rtc: 88pm80x: " Uwe Kleine-König
2023-03-04 13:29 ` [PATCH 02/41] rtc: 88pm860x: " Uwe Kleine-König
2023-03-04 13:29 ` [PATCH 03/41] rtc: ab8500: " Uwe Kleine-König
2023-03-07 13:35   ` Linus Walleij
2023-03-04 13:29 ` [PATCH 04/41] rtc: ac100: " Uwe Kleine-König
2023-03-04 13:29 ` [PATCH 05/41] rtc: asm9260: " Uwe Kleine-König
2023-03-04 13:29 ` [PATCH 06/41] rtc: at91sam9: " Uwe Kleine-König
2023-03-06 11:55   ` Claudiu.Beznea
2023-03-04 13:29 ` [PATCH 07/41] rtc: brcmstb-waketimer: " Uwe Kleine-König
2023-03-04 13:29 ` [PATCH 08/41] rtc: cadence: " Uwe Kleine-König
2023-03-04 13:29 ` [PATCH 09/41] rtc: cmos: " Uwe Kleine-König
2023-03-04 13:29 ` [PATCH 10/41] rtc: cros-ec: " Uwe Kleine-König
2023-03-07  5:30   ` Tzung-Bi Shih
2023-03-04 13:29 ` [PATCH 11/41] rtc: ds1685: " Uwe Kleine-König
2023-03-06 19:43   ` Joshua Kinard
2023-03-06 21:22     ` Uwe Kleine-König
2023-03-07  2:09       ` Joshua Kinard
2023-03-07  8:11         ` Uwe Kleine-König
2023-03-08 16:20           ` Joshua Kinard
2023-03-08 16:47             ` Uwe Kleine-König
2023-03-13 15:08               ` Joshua Kinard
2023-03-04 13:29 ` [PATCH 12/41] rtc: ftrtc010: " Uwe Kleine-König
2023-03-07 13:35   ` Linus Walleij
2023-03-04 13:30 ` [PATCH 13/41] rtc: hid-sensor-time: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 14/41] rtc: lpc24xx: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 15/41] rtc: max77686: " Uwe Kleine-König
2023-03-05  9:50   ` Krzysztof Kozlowski
2023-03-04 13:30 ` [PATCH 16/41] rtc: mc13xxx: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 17/41] rtc: mpc5121: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 18/41] rtc: mpfs: " Uwe Kleine-König
2023-03-04 13:47   ` Conor Dooley
2023-03-04 13:30 ` [PATCH 19/41] rtc: mt7622: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 20/41] rtc: mxc_v2: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 21/41] rtc: omap: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 22/41] rtc: palmas: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 23/41] rtc: pcf50633: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 24/41] rtc: pic32: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 25/41] rtc: pm8xxx: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 26/41] rtc: rc5t583: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 27/41] rtc: rtd119x: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 28/41] rtc: rzn1: " Uwe Kleine-König
2023-03-06  8:12   ` Miquel Raynal
2023-03-04 13:30 ` [PATCH 29/41] rtc: s3c: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 30/41] rtc: sa1100: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 31/41] rtc: spear: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 32/41] rtc: stm32: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 33/41] rtc: stmp3xxx: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 34/41] rtc: sunplus: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 35/41] rtc: tegra: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 36/41] rtc: tps6586x: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 37/41] rtc: twl: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 38/41] rtc: vt8500: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 39/41] rtc: wm8350: " Uwe Kleine-König
2023-03-06  9:37   ` Charles Keepax
2023-03-04 13:30 ` [PATCH 40/41] rtc: xgene: " Uwe Kleine-König
2023-03-04 13:30 ` [PATCH 41/41] rtc: zynqmp: " Uwe Kleine-König
2023-03-14  9:05 ` [PATCH 00/41] rtc: " Naresh Kamboju
2023-03-17 22:09 ` Alexandre Belloni
2023-05-08  3:45 ` patchwork-bot+chrome-platform
2023-05-08  3:56 ` patchwork-bot+chrome-platform

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).