linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/40] soc/aspeed: aspeed-lpc-ctrl: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
@ 2023-09-25  9:54 ` Uwe Kleine-König
  2023-09-26  1:33   ` Andrew Jeffery
  2023-09-25  9:54 ` [PATCH 02/40] soc/aspeed: aspeed-lpc-snoop: " Uwe Kleine-König
                   ` (17 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:54 UTC (permalink / raw)
  To: Joel Stanley
  Cc: Andrew Jeffery, linux-arm-kernel, linux-aspeed, linux-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/aspeed/aspeed-lpc-ctrl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/aspeed/aspeed-lpc-ctrl.c b/drivers/soc/aspeed/aspeed-lpc-ctrl.c
index 258894ed234b..e87038009d1b 100644
--- a/drivers/soc/aspeed/aspeed-lpc-ctrl.c
+++ b/drivers/soc/aspeed/aspeed-lpc-ctrl.c
@@ -332,14 +332,12 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static int aspeed_lpc_ctrl_remove(struct platform_device *pdev)
+static void aspeed_lpc_ctrl_remove(struct platform_device *pdev)
 {
 	struct aspeed_lpc_ctrl *lpc_ctrl = dev_get_drvdata(&pdev->dev);
 
 	misc_deregister(&lpc_ctrl->miscdev);
 	clk_disable_unprepare(lpc_ctrl->clk);
-
-	return 0;
 }
 
 static const struct of_device_id aspeed_lpc_ctrl_match[] = {
@@ -355,7 +353,7 @@ static struct platform_driver aspeed_lpc_ctrl_driver = {
 		.of_match_table = aspeed_lpc_ctrl_match,
 	},
 	.probe = aspeed_lpc_ctrl_probe,
-	.remove = aspeed_lpc_ctrl_remove,
+	.remove_new = aspeed_lpc_ctrl_remove,
 };
 
 module_platform_driver(aspeed_lpc_ctrl_driver);
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 02/40] soc/aspeed: aspeed-lpc-snoop: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
  2023-09-25  9:54 ` [PATCH 01/40] soc/aspeed: aspeed-lpc-ctrl: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-25  9:54 ` Uwe Kleine-König
  2023-09-26  1:30   ` Andrew Jeffery
  2023-09-25  9:54 ` [PATCH 03/40] soc/aspeed: aspeed-p2a-ctrl: " Uwe Kleine-König
                   ` (16 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:54 UTC (permalink / raw)
  To: Joel Stanley
  Cc: Andrew Jeffery, Rob Herring, Arnd Bergmann, linux-arm-kernel,
	linux-aspeed, linux-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/aspeed/aspeed-lpc-snoop.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c
index 773dbcbc03a6..888b5840c015 100644
--- a/drivers/soc/aspeed/aspeed-lpc-snoop.c
+++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c
@@ -331,7 +331,7 @@ static int aspeed_lpc_snoop_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static int aspeed_lpc_snoop_remove(struct platform_device *pdev)
+static void aspeed_lpc_snoop_remove(struct platform_device *pdev)
 {
 	struct aspeed_lpc_snoop *lpc_snoop = dev_get_drvdata(&pdev->dev);
 
@@ -340,8 +340,6 @@ static int aspeed_lpc_snoop_remove(struct platform_device *pdev)
 	aspeed_lpc_disable_snoop(lpc_snoop, 1);
 
 	clk_disable_unprepare(lpc_snoop->clk);
-
-	return 0;
 }
 
 static const struct aspeed_lpc_snoop_model_data ast2400_model_data = {
@@ -368,7 +366,7 @@ static struct platform_driver aspeed_lpc_snoop_driver = {
 		.of_match_table = aspeed_lpc_snoop_match,
 	},
 	.probe = aspeed_lpc_snoop_probe,
-	.remove = aspeed_lpc_snoop_remove,
+	.remove_new = aspeed_lpc_snoop_remove,
 };
 
 module_platform_driver(aspeed_lpc_snoop_driver);
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 03/40] soc/aspeed: aspeed-p2a-ctrl: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
  2023-09-25  9:54 ` [PATCH 01/40] soc/aspeed: aspeed-lpc-ctrl: Convert to platform remove callback returning void Uwe Kleine-König
  2023-09-25  9:54 ` [PATCH 02/40] soc/aspeed: aspeed-lpc-snoop: " Uwe Kleine-König
@ 2023-09-25  9:54 ` Uwe Kleine-König
  2023-09-26  1:32   ` Andrew Jeffery
  2023-09-25  9:54 ` [PATCH 04/40] soc/aspeed: aspeed-uart-routing: " Uwe Kleine-König
                   ` (15 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:54 UTC (permalink / raw)
  To: Joel Stanley
  Cc: Andrew Jeffery, Rob Herring, Arnd Bergmann, linux-arm-kernel,
	linux-aspeed, linux-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/aspeed/aspeed-p2a-ctrl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/aspeed/aspeed-p2a-ctrl.c b/drivers/soc/aspeed/aspeed-p2a-ctrl.c
index 548f44da28a9..8610ddacc7bc 100644
--- a/drivers/soc/aspeed/aspeed-p2a-ctrl.c
+++ b/drivers/soc/aspeed/aspeed-p2a-ctrl.c
@@ -383,13 +383,11 @@ static int aspeed_p2a_ctrl_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static int aspeed_p2a_ctrl_remove(struct platform_device *pdev)
+static void aspeed_p2a_ctrl_remove(struct platform_device *pdev)
 {
 	struct aspeed_p2a_ctrl *p2a_ctrl = dev_get_drvdata(&pdev->dev);
 
 	misc_deregister(&p2a_ctrl->miscdev);
-
-	return 0;
 }
 
 #define SCU2C_DRAM	BIT(25)
@@ -433,7 +431,7 @@ static struct platform_driver aspeed_p2a_ctrl_driver = {
 		.of_match_table = aspeed_p2a_ctrl_match,
 	},
 	.probe = aspeed_p2a_ctrl_probe,
-	.remove = aspeed_p2a_ctrl_remove,
+	.remove_new = aspeed_p2a_ctrl_remove,
 };
 
 module_platform_driver(aspeed_p2a_ctrl_driver);
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 04/40] soc/aspeed: aspeed-uart-routing: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (2 preceding siblings ...)
  2023-09-25  9:54 ` [PATCH 03/40] soc/aspeed: aspeed-p2a-ctrl: " Uwe Kleine-König
@ 2023-09-25  9:54 ` Uwe Kleine-König
  2023-09-26  1:31   ` Andrew Jeffery
  2023-09-25  9:54 ` [PATCH 05/40] soc/fsl: dpaa2-console: " Uwe Kleine-König
                   ` (14 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:54 UTC (permalink / raw)
  To: Joel Stanley
  Cc: Andrew Jeffery, Arnd Bergmann, Rob Herring, Zev Weiss,
	linux-arm-kernel, linux-aspeed, linux-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/aspeed/aspeed-uart-routing.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/aspeed/aspeed-uart-routing.c b/drivers/soc/aspeed/aspeed-uart-routing.c
index 3a4c1f28cb34..a2195f062e01 100644
--- a/drivers/soc/aspeed/aspeed-uart-routing.c
+++ b/drivers/soc/aspeed/aspeed-uart-routing.c
@@ -565,14 +565,12 @@ static int aspeed_uart_routing_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int aspeed_uart_routing_remove(struct platform_device *pdev)
+static void aspeed_uart_routing_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct aspeed_uart_routing *uart_routing = platform_get_drvdata(pdev);
 
 	sysfs_remove_group(&dev->kobj, uart_routing->attr_grp);
-
-	return 0;
 }
 
 static const struct of_device_id aspeed_uart_routing_table[] = {
@@ -591,7 +589,7 @@ static struct platform_driver aspeed_uart_routing_driver = {
 		.of_match_table = aspeed_uart_routing_table,
 	},
 	.probe = aspeed_uart_routing_probe,
-	.remove = aspeed_uart_routing_remove,
+	.remove_new = aspeed_uart_routing_remove,
 };
 
 module_platform_driver(aspeed_uart_routing_driver);
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 05/40] soc/fsl: dpaa2-console: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (3 preceding siblings ...)
  2023-09-25  9:54 ` [PATCH 04/40] soc/aspeed: aspeed-uart-routing: " Uwe Kleine-König
@ 2023-09-25  9:54 ` Uwe Kleine-König
  2023-09-25  9:54 ` [PATCH 06/40] soc/fsl: cpm: qmc: " Uwe Kleine-König
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:54 UTC (permalink / raw)
  To: Li Yang; +Cc: linuxppc-dev, linux-arm-kernel, linux-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/fsl/dpaa2-console.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/fsl/dpaa2-console.c b/drivers/soc/fsl/dpaa2-console.c
index 1dca693b6b38..6dbc77db7718 100644
--- a/drivers/soc/fsl/dpaa2-console.c
+++ b/drivers/soc/fsl/dpaa2-console.c
@@ -300,12 +300,10 @@ static int dpaa2_console_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int dpaa2_console_remove(struct platform_device *pdev)
+static void dpaa2_console_remove(struct platform_device *pdev)
 {
 	misc_deregister(&dpaa2_mc_console_dev);
 	misc_deregister(&dpaa2_aiop_console_dev);
-
-	return 0;
 }
 
 static const struct of_device_id dpaa2_console_match_table[] = {
@@ -322,7 +320,7 @@ static struct platform_driver dpaa2_console_driver = {
 		   .of_match_table = dpaa2_console_match_table,
 		   },
 	.probe = dpaa2_console_probe,
-	.remove = dpaa2_console_remove,
+	.remove_new = dpaa2_console_remove,
 };
 module_platform_driver(dpaa2_console_driver);
 
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 06/40] soc/fsl: cpm: qmc: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (4 preceding siblings ...)
  2023-09-25  9:54 ` [PATCH 05/40] soc/fsl: dpaa2-console: " Uwe Kleine-König
@ 2023-09-25  9:54 ` Uwe Kleine-König
  2023-09-27  6:44   ` Herve Codina
  2023-09-25  9:54 ` [PATCH 07/40] soc/fsl: cpm: tsa: " Uwe Kleine-König
                   ` (12 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:54 UTC (permalink / raw)
  To: Herve Codina, Qiang Zhao, Li Yang
  Cc: linuxppc-dev, linux-arm-kernel, linux-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/fsl/qe/qmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c
index b3c292c9a14e..92ec76c03965 100644
--- a/drivers/soc/fsl/qe/qmc.c
+++ b/drivers/soc/fsl/qe/qmc.c
@@ -1415,7 +1415,7 @@ static int qmc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int qmc_remove(struct platform_device *pdev)
+static void qmc_remove(struct platform_device *pdev)
 {
 	struct qmc *qmc = platform_get_drvdata(pdev);
 
@@ -1427,8 +1427,6 @@ static int qmc_remove(struct platform_device *pdev)
 
 	/* Disconnect the serial from TSA */
 	tsa_serial_disconnect(qmc->tsa_serial);
-
-	return 0;
 }
 
 static const struct of_device_id qmc_id_table[] = {
@@ -1443,7 +1441,7 @@ static struct platform_driver qmc_driver = {
 		.of_match_table = of_match_ptr(qmc_id_table),
 	},
 	.probe = qmc_probe,
-	.remove = qmc_remove,
+	.remove_new = qmc_remove,
 };
 module_platform_driver(qmc_driver);
 
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 07/40] soc/fsl: cpm: tsa: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (5 preceding siblings ...)
  2023-09-25  9:54 ` [PATCH 06/40] soc/fsl: cpm: qmc: " Uwe Kleine-König
@ 2023-09-25  9:54 ` Uwe Kleine-König
  2023-09-27  6:44   ` Herve Codina
  2023-09-25  9:55 ` [PATCH 14/40] soc/mediatek: mtk-devapc: " Uwe Kleine-König
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:54 UTC (permalink / raw)
  To: Herve Codina, Qiang Zhao, Li Yang
  Cc: linuxppc-dev, linux-arm-kernel, linux-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/fsl/qe/tsa.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/fsl/qe/tsa.c b/drivers/soc/fsl/qe/tsa.c
index 3646153117b3..3f9981335590 100644
--- a/drivers/soc/fsl/qe/tsa.c
+++ b/drivers/soc/fsl/qe/tsa.c
@@ -706,7 +706,7 @@ static int tsa_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int tsa_remove(struct platform_device *pdev)
+static void tsa_remove(struct platform_device *pdev)
 {
 	struct tsa *tsa = platform_get_drvdata(pdev);
 	int i;
@@ -729,7 +729,6 @@ static int tsa_remove(struct platform_device *pdev)
 			clk_put(tsa->tdm[i].l1rclk_clk);
 		}
 	}
-	return 0;
 }
 
 static const struct of_device_id tsa_id_table[] = {
@@ -744,7 +743,7 @@ static struct platform_driver tsa_driver = {
 		.of_match_table = of_match_ptr(tsa_id_table),
 	},
 	.probe = tsa_probe,
-	.remove = tsa_remove,
+	.remove_new = tsa_remove,
 };
 module_platform_driver(tsa_driver);
 
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 14/40] soc/mediatek: mtk-devapc: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (6 preceding siblings ...)
  2023-09-25  9:54 ` [PATCH 07/40] soc/fsl: cpm: tsa: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-09-26  9:23   ` AngeloGioacchino Del Regno
  2023-09-25  9:55 ` [PATCH 15/40] soc/mediatek: mtk-mmsys: " Uwe Kleine-König
                   ` (10 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: AngeloGioacchino Del Regno, linux-kernel, linux-arm-kernel,
	linux-mediatek, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/mediatek/mtk-devapc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-devapc.c b/drivers/soc/mediatek/mtk-devapc.c
index b28feb967540..56cc345552a4 100644
--- a/drivers/soc/mediatek/mtk-devapc.c
+++ b/drivers/soc/mediatek/mtk-devapc.c
@@ -292,18 +292,16 @@ static int mtk_devapc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int mtk_devapc_remove(struct platform_device *pdev)
+static void mtk_devapc_remove(struct platform_device *pdev)
 {
 	struct mtk_devapc_context *ctx = platform_get_drvdata(pdev);
 
 	stop_devapc(ctx);
-
-	return 0;
 }
 
 static struct platform_driver mtk_devapc_driver = {
 	.probe = mtk_devapc_probe,
-	.remove = mtk_devapc_remove,
+	.remove_new = mtk_devapc_remove,
 	.driver = {
 		.name = "mtk-devapc",
 		.of_match_table = mtk_devapc_dt_match,
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 15/40] soc/mediatek: mtk-mmsys: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (7 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 14/40] soc/mediatek: mtk-devapc: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-09-26  9:23   ` AngeloGioacchino Del Regno
  2023-09-25  9:55 ` [PATCH 30/40] soc/rockchip: io-domain: " Uwe Kleine-König
                   ` (9 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Matthias Brugger
  Cc: AngeloGioacchino Del Regno, linux-kernel, linux-arm-kernel,
	linux-mediatek, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/mediatek/mtk-mmsys.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
index ffb75711a1da..88209102ff3b 100644
--- a/drivers/soc/mediatek/mtk-mmsys.c
+++ b/drivers/soc/mediatek/mtk-mmsys.c
@@ -410,14 +410,12 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int mtk_mmsys_remove(struct platform_device *pdev)
+static void mtk_mmsys_remove(struct platform_device *pdev)
 {
 	struct mtk_mmsys *mmsys = platform_get_drvdata(pdev);
 
 	platform_device_unregister(mmsys->drm_pdev);
 	platform_device_unregister(mmsys->clks_pdev);
-
-	return 0;
 }
 
 static const struct of_device_id of_match_mtk_mmsys[] = {
@@ -449,7 +447,7 @@ static struct platform_driver mtk_mmsys_drv = {
 		.of_match_table = of_match_mtk_mmsys,
 	},
 	.probe = mtk_mmsys_probe,
-	.remove = mtk_mmsys_remove,
+	.remove_new = mtk_mmsys_remove,
 };
 module_platform_driver(mtk_mmsys_drv);
 
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 30/40] soc/rockchip: io-domain: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (8 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 15/40] soc/mediatek: mtk-mmsys: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-10-01 22:58   ` Heiko Stuebner
  2023-09-25  9:55 ` [PATCH 31/40] soc/samsung: exynos-chipid: " Uwe Kleine-König
                   ` (8 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Heiko Stuebner; +Cc: linux-arm-kernel, linux-rockchip, linux-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/rockchip/io-domain.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/rockchip/io-domain.c b/drivers/soc/rockchip/io-domain.c
index 6619256c2d11..18f809c160a7 100644
--- a/drivers/soc/rockchip/io-domain.c
+++ b/drivers/soc/rockchip/io-domain.c
@@ -687,7 +687,7 @@ static int rockchip_iodomain_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int rockchip_iodomain_remove(struct platform_device *pdev)
+static void rockchip_iodomain_remove(struct platform_device *pdev)
 {
 	struct rockchip_iodomain *iod = platform_get_drvdata(pdev);
 	int i;
@@ -699,13 +699,11 @@ static int rockchip_iodomain_remove(struct platform_device *pdev)
 			regulator_unregister_notifier(io_supply->reg,
 						      &io_supply->nb);
 	}
-
-	return 0;
 }
 
 static struct platform_driver rockchip_iodomain_driver = {
 	.probe   = rockchip_iodomain_probe,
-	.remove  = rockchip_iodomain_remove,
+	.remove_new = rockchip_iodomain_remove,
 	.driver  = {
 		.name  = "rockchip-iodomain",
 		.of_match_table = rockchip_iodomain_match,
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 31/40] soc/samsung: exynos-chipid: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (9 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 30/40] soc/rockchip: io-domain: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-09-28  5:52   ` (subset) " Krzysztof Kozlowski
  2023-09-25  9:55 ` [PATCH 33/40] soc/ti: k3-ringacc: " Uwe Kleine-König
                   ` (7 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Alim Akhtar, linux-arm-kernel, linux-samsung-soc, linux-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/samsung/exynos-chipid.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
index 7ba45c4aff97..3fd0f2b84dd3 100644
--- a/drivers/soc/samsung/exynos-chipid.c
+++ b/drivers/soc/samsung/exynos-chipid.c
@@ -158,13 +158,11 @@ static int exynos_chipid_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int exynos_chipid_remove(struct platform_device *pdev)
+static void exynos_chipid_remove(struct platform_device *pdev)
 {
 	struct soc_device *soc_dev = platform_get_drvdata(pdev);
 
 	soc_device_unregister(soc_dev);
-
-	return 0;
 }
 
 static const struct exynos_chipid_variant exynos4210_chipid_drv_data = {
@@ -197,7 +195,7 @@ static struct platform_driver exynos_chipid_driver = {
 		.of_match_table = exynos_chipid_of_device_ids,
 	},
 	.probe	= exynos_chipid_probe,
-	.remove	= exynos_chipid_remove,
+	.remove_new = exynos_chipid_remove,
 };
 module_platform_driver(exynos_chipid_driver);
 
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 33/40] soc/ti: k3-ringacc: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (10 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 31/40] soc/samsung: exynos-chipid: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-09-25  9:55 ` [PATCH 34/40] soc/ti: knav_dma: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar; +Cc: linux-kernel, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/ti/k3-ringacc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c
index 148f54d9691d..fd4251d75935 100644
--- a/drivers/soc/ti/k3-ringacc.c
+++ b/drivers/soc/ti/k3-ringacc.c
@@ -1551,19 +1551,18 @@ static int k3_ringacc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int k3_ringacc_remove(struct platform_device *pdev)
+static void k3_ringacc_remove(struct platform_device *pdev)
 {
 	struct k3_ringacc *ringacc = dev_get_drvdata(&pdev->dev);
 
 	mutex_lock(&k3_ringacc_list_lock);
 	list_del(&ringacc->list);
 	mutex_unlock(&k3_ringacc_list_lock);
-	return 0;
 }
 
 static struct platform_driver k3_ringacc_driver = {
 	.probe		= k3_ringacc_probe,
-	.remove		= k3_ringacc_remove,
+	.remove_new	= k3_ringacc_remove,
 	.driver		= {
 		.name	= "k3-ringacc",
 		.of_match_table = k3_ringacc_of_match,
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 34/40] soc/ti: knav_dma: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (11 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 33/40] soc/ti: k3-ringacc: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-09-25  9:55 ` [PATCH 35/40] soc/ti: knav_qmss_queue: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar; +Cc: linux-kernel, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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

diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
index 0fbc37cd5123..6023006685fc 100644
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -773,7 +773,7 @@ static int knav_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int knav_dma_remove(struct platform_device *pdev)
+static void knav_dma_remove(struct platform_device *pdev)
 {
 	struct knav_dma_device *dma;
 
@@ -784,8 +784,6 @@ static int knav_dma_remove(struct platform_device *pdev)
 
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static struct of_device_id of_match[] = {
@@ -797,7 +795,7 @@ MODULE_DEVICE_TABLE(of, of_match);
 
 static struct platform_driver knav_dma_driver = {
 	.probe	= knav_dma_probe,
-	.remove	= knav_dma_remove,
+	.remove_new = knav_dma_remove,
 	.driver = {
 		.name		= "keystone-navigator-dma",
 		.of_match_table	= of_match,
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 35/40] soc/ti: knav_qmss_queue: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (12 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 34/40] soc/ti: knav_dma: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-09-25  9:55 ` [PATCH 36/40] soc/ti: pm33xx: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar; +Cc: linux-kernel, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/ti/knav_qmss_queue.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 0f252c2549ba..cea791717957 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -1884,17 +1884,16 @@ static int knav_queue_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int knav_queue_remove(struct platform_device *pdev)
+static void knav_queue_remove(struct platform_device *pdev)
 {
 	/* TODO: Free resources */
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-	return 0;
 }
 
 static struct platform_driver keystone_qmss_driver = {
 	.probe		= knav_queue_probe,
-	.remove		= knav_queue_remove,
+	.remove_new	= knav_queue_remove,
 	.driver		= {
 		.name	= "keystone-navigator-qmss",
 		.of_match_table = keystone_qmss_of_match,
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 36/40] soc/ti: pm33xx: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (13 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 35/40] soc/ti: knav_qmss_queue: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-09-25  9:55 ` [PATCH 37/40] soc/ti: pruss: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar; +Cc: linux-kernel, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/ti/pm33xx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c
index f04c21157904..8e983c3c4e03 100644
--- a/drivers/soc/ti/pm33xx.c
+++ b/drivers/soc/ti/pm33xx.c
@@ -583,7 +583,7 @@ static int am33xx_pm_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int am33xx_pm_remove(struct platform_device *pdev)
+static void am33xx_pm_remove(struct platform_device *pdev)
 {
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
@@ -594,7 +594,6 @@ static int am33xx_pm_remove(struct platform_device *pdev)
 	am33xx_pm_free_sram();
 	iounmap(rtc_base_virt);
 	clk_put(rtc_fck);
-	return 0;
 }
 
 static struct platform_driver am33xx_pm_driver = {
@@ -602,7 +601,7 @@ static struct platform_driver am33xx_pm_driver = {
 		.name   = "pm33xx",
 	},
 	.probe = am33xx_pm_probe,
-	.remove = am33xx_pm_remove,
+	.remove_new = am33xx_pm_remove,
 };
 module_platform_driver(am33xx_pm_driver);
 
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 37/40] soc/ti: pruss: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (14 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 36/40] soc/ti: pm33xx: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-09-25  9:55 ` [PATCH 38/40] soc/ti: smartreflex: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar; +Cc: linux-kernel, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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

diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index f49f8492dde5..24a42e0b645c 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -565,7 +565,7 @@ static int pruss_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pruss_remove(struct platform_device *pdev)
+static void pruss_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 
@@ -573,8 +573,6 @@ static int pruss_remove(struct platform_device *pdev)
 
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
-
-	return 0;
 }
 
 /* instance-specific driver private data */
@@ -610,7 +608,7 @@ static struct platform_driver pruss_driver = {
 		.of_match_table = pruss_of_match,
 	},
 	.probe  = pruss_probe,
-	.remove = pruss_remove,
+	.remove_new = pruss_remove,
 };
 module_platform_driver(pruss_driver);
 
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 38/40] soc/ti: smartreflex: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (15 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 37/40] soc/ti: pruss: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-09-25  9:55 ` [PATCH 39/40] soc/ti: wkup_m3_ipc: " Uwe Kleine-König
  2023-09-25  9:55 ` [PATCH 40/40] soc/xilinx: zynqmp_power: " Uwe Kleine-König
  18 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar
  Cc: linux-kernel, linux-arm-kernel, linux-pm, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/soc/ti/smartreflex.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/ti/smartreflex.c b/drivers/soc/ti/smartreflex.c
index 62b2f1464e46..d6219060b616 100644
--- a/drivers/soc/ti/smartreflex.c
+++ b/drivers/soc/ti/smartreflex.c
@@ -933,7 +933,7 @@ static int omap_sr_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int omap_sr_remove(struct platform_device *pdev)
+static void omap_sr_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct omap_sr *sr_info = platform_get_drvdata(pdev);
@@ -945,7 +945,6 @@ static int omap_sr_remove(struct platform_device *pdev)
 	pm_runtime_disable(dev);
 	clk_unprepare(sr_info->fck);
 	list_del(&sr_info->node);
-	return 0;
 }
 
 static void omap_sr_shutdown(struct platform_device *pdev)
@@ -970,7 +969,7 @@ MODULE_DEVICE_TABLE(of, omap_sr_match);
 
 static struct platform_driver smartreflex_driver = {
 	.probe		= omap_sr_probe,
-	.remove         = omap_sr_remove,
+	.remove_new     = omap_sr_remove,
 	.shutdown	= omap_sr_shutdown,
 	.driver		= {
 		.name	= DRIVER_NAME,
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 39/40] soc/ti: wkup_m3_ipc: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (16 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 38/40] soc/ti: smartreflex: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-09-25  9:55 ` [PATCH 40/40] soc/xilinx: zynqmp_power: " Uwe Kleine-König
  18 siblings, 0 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar; +Cc: linux-kernel, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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

diff --git a/drivers/soc/ti/wkup_m3_ipc.c b/drivers/soc/ti/wkup_m3_ipc.c
index 3aff106fc11a..6a1c6b34c414 100644
--- a/drivers/soc/ti/wkup_m3_ipc.c
+++ b/drivers/soc/ti/wkup_m3_ipc.c
@@ -713,7 +713,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int wkup_m3_ipc_remove(struct platform_device *pdev)
+static void wkup_m3_ipc_remove(struct platform_device *pdev)
 {
 	wkup_m3_ipc_dbg_destroy(m3_ipc_state);
 
@@ -723,8 +723,6 @@ static int wkup_m3_ipc_remove(struct platform_device *pdev)
 	rproc_put(m3_ipc_state->rproc);
 
 	m3_ipc_state = NULL;
-
-	return 0;
 }
 
 static int __maybe_unused wkup_m3_ipc_suspend(struct device *dev)
@@ -760,7 +758,7 @@ MODULE_DEVICE_TABLE(of, wkup_m3_ipc_of_match);
 
 static struct platform_driver wkup_m3_ipc_driver = {
 	.probe = wkup_m3_ipc_probe,
-	.remove = wkup_m3_ipc_remove,
+	.remove_new = wkup_m3_ipc_remove,
 	.driver = {
 		.name = "wkup_m3_ipc",
 		.of_match_table = wkup_m3_ipc_of_match,
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 40/40] soc/xilinx: zynqmp_power: Convert to platform remove callback returning void
       [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
                   ` (17 preceding siblings ...)
  2023-09-25  9:55 ` [PATCH 39/40] soc/ti: wkup_m3_ipc: " Uwe Kleine-König
@ 2023-09-25  9:55 ` Uwe Kleine-König
  2023-10-02  9:13   ` Michal Simek
  18 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-09-25  9:55 UTC (permalink / raw)
  To: Michal Simek
  Cc: Rob Herring, Ruan Jinjie, Arnd Bergmann, linux-arm-kernel,
	linux-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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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

diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
index c2c819701eec..9d27f850f491 100644
--- a/drivers/soc/xilinx/zynqmp_power.c
+++ b/drivers/soc/xilinx/zynqmp_power.c
@@ -275,7 +275,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int zynqmp_pm_remove(struct platform_device *pdev)
+static void zynqmp_pm_remove(struct platform_device *pdev)
 {
 	sysfs_remove_file(&pdev->dev.kobj, &dev_attr_suspend_mode.attr);
 	if (event_registered)
@@ -283,8 +283,6 @@ static int zynqmp_pm_remove(struct platform_device *pdev)
 
 	if (!rx_chan)
 		mbox_free_channel(rx_chan);
-
-	return 0;
 }
 
 static const struct of_device_id pm_of_match[] = {
@@ -295,7 +293,7 @@ MODULE_DEVICE_TABLE(of, pm_of_match);
 
 static struct platform_driver zynqmp_pm_platform_driver = {
 	.probe = zynqmp_pm_probe,
-	.remove = zynqmp_pm_remove,
+	.remove_new = zynqmp_pm_remove,
 	.driver = {
 		.name = "zynqmp_power",
 		.of_match_table = pm_of_match,
-- 
2.40.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 02/40] soc/aspeed: aspeed-lpc-snoop: Convert to platform remove callback returning void
  2023-09-25  9:54 ` [PATCH 02/40] soc/aspeed: aspeed-lpc-snoop: " Uwe Kleine-König
@ 2023-09-26  1:30   ` Andrew Jeffery
  0 siblings, 0 replies; 30+ messages in thread
From: Andrew Jeffery @ 2023-09-26  1:30 UTC (permalink / raw)
  To: Uwe Kleine-König, Joel Stanley
  Cc: Rob Herring, Arnd Bergmann, linux-arm-kernel, linux-aspeed,
	linux-kernel, Pengutronix Kernel Team



On Mon, 25 Sep 2023, at 19:24, 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> 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: Andrew Jeffery <andrew@aj.id.au>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 04/40] soc/aspeed: aspeed-uart-routing: Convert to platform remove callback returning void
  2023-09-25  9:54 ` [PATCH 04/40] soc/aspeed: aspeed-uart-routing: " Uwe Kleine-König
@ 2023-09-26  1:31   ` Andrew Jeffery
  0 siblings, 0 replies; 30+ messages in thread
From: Andrew Jeffery @ 2023-09-26  1:31 UTC (permalink / raw)
  To: Uwe Kleine-König, Joel Stanley
  Cc: Arnd Bergmann, Rob Herring, Zev Weiss, linux-arm-kernel,
	linux-aspeed, linux-kernel, Pengutronix Kernel Team



On Mon, 25 Sep 2023, at 19:24, 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> 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: Andrew Jeffery <andrew@aj.id.au>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 03/40] soc/aspeed: aspeed-p2a-ctrl: Convert to platform remove callback returning void
  2023-09-25  9:54 ` [PATCH 03/40] soc/aspeed: aspeed-p2a-ctrl: " Uwe Kleine-König
@ 2023-09-26  1:32   ` Andrew Jeffery
  0 siblings, 0 replies; 30+ messages in thread
From: Andrew Jeffery @ 2023-09-26  1:32 UTC (permalink / raw)
  To: Uwe Kleine-König, Joel Stanley
  Cc: Rob Herring, Arnd Bergmann, linux-arm-kernel, linux-aspeed,
	linux-kernel, Pengutronix Kernel Team



On Mon, 25 Sep 2023, at 19:24, 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> 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: Andrew Jeffery <andrew@aj.id.au>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 01/40] soc/aspeed: aspeed-lpc-ctrl: Convert to platform remove callback returning void
  2023-09-25  9:54 ` [PATCH 01/40] soc/aspeed: aspeed-lpc-ctrl: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-26  1:33   ` Andrew Jeffery
  0 siblings, 0 replies; 30+ messages in thread
From: Andrew Jeffery @ 2023-09-26  1:33 UTC (permalink / raw)
  To: Uwe Kleine-König, Joel Stanley
  Cc: linux-arm-kernel, linux-aspeed, linux-kernel,
	Pengutronix Kernel Team



On Mon, 25 Sep 2023, at 19:24, 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> 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: Andrew Jeffery <andrew@aj.id.au>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 15/40] soc/mediatek: mtk-mmsys: Convert to platform remove callback returning void
  2023-09-25  9:55 ` [PATCH 15/40] soc/mediatek: mtk-mmsys: " Uwe Kleine-König
@ 2023-09-26  9:23   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-26  9:23 UTC (permalink / raw)
  To: Uwe Kleine-König, Matthias Brugger
  Cc: linux-kernel, linux-arm-kernel, linux-mediatek, kernel

Il 25/09/23 11:55, Uwe Kleine-König ha scritto:
> 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> 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: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 14/40] soc/mediatek: mtk-devapc: Convert to platform remove callback returning void
  2023-09-25  9:55 ` [PATCH 14/40] soc/mediatek: mtk-devapc: " Uwe Kleine-König
@ 2023-09-26  9:23   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 30+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-26  9:23 UTC (permalink / raw)
  To: Uwe Kleine-König, Matthias Brugger
  Cc: linux-kernel, linux-arm-kernel, linux-mediatek, kernel

Il 25/09/23 11:55, Uwe Kleine-König ha scritto:
> 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> 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: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 07/40] soc/fsl: cpm: tsa: Convert to platform remove callback returning void
  2023-09-25  9:54 ` [PATCH 07/40] soc/fsl: cpm: tsa: " Uwe Kleine-König
@ 2023-09-27  6:44   ` Herve Codina
  0 siblings, 0 replies; 30+ messages in thread
From: Herve Codina @ 2023-09-27  6:44 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Qiang Zhao, Li Yang, linuxppc-dev, linux-arm-kernel, linux-kernel,
	kernel

Hi Uwe,

On Mon, 25 Sep 2023 11:54:58 +0200
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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> 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/soc/fsl/qe/tsa.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/soc/fsl/qe/tsa.c b/drivers/soc/fsl/qe/tsa.c
> index 3646153117b3..3f9981335590 100644
> --- a/drivers/soc/fsl/qe/tsa.c
> +++ b/drivers/soc/fsl/qe/tsa.c
> @@ -706,7 +706,7 @@ static int tsa_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int tsa_remove(struct platform_device *pdev)
> +static void tsa_remove(struct platform_device *pdev)
>  {
>  	struct tsa *tsa = platform_get_drvdata(pdev);
>  	int i;
> @@ -729,7 +729,6 @@ static int tsa_remove(struct platform_device *pdev)
>  			clk_put(tsa->tdm[i].l1rclk_clk);
>  		}
>  	}
> -	return 0;
>  }
>  
>  static const struct of_device_id tsa_id_table[] = {
> @@ -744,7 +743,7 @@ static struct platform_driver tsa_driver = {
>  		.of_match_table = of_match_ptr(tsa_id_table),
>  	},
>  	.probe = tsa_probe,
> -	.remove = tsa_remove,
> +	.remove_new = tsa_remove,
>  };
>  module_platform_driver(tsa_driver);
>  

Acked-by: Herve Codina <herve.codina@bootlin.com>

Best regards,
Hervé

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 06/40] soc/fsl: cpm: qmc: Convert to platform remove callback returning void
  2023-09-25  9:54 ` [PATCH 06/40] soc/fsl: cpm: qmc: " Uwe Kleine-König
@ 2023-09-27  6:44   ` Herve Codina
  0 siblings, 0 replies; 30+ messages in thread
From: Herve Codina @ 2023-09-27  6:44 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Qiang Zhao, Li Yang, linuxppc-dev, linux-arm-kernel, linux-kernel,
	kernel

On Mon, 25 Sep 2023 11:54:57 +0200
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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> 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/soc/fsl/qe/qmc.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c
> index b3c292c9a14e..92ec76c03965 100644
> --- a/drivers/soc/fsl/qe/qmc.c
> +++ b/drivers/soc/fsl/qe/qmc.c
> @@ -1415,7 +1415,7 @@ static int qmc_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int qmc_remove(struct platform_device *pdev)
> +static void qmc_remove(struct platform_device *pdev)
>  {
>  	struct qmc *qmc = platform_get_drvdata(pdev);
>  
> @@ -1427,8 +1427,6 @@ static int qmc_remove(struct platform_device *pdev)
>  
>  	/* Disconnect the serial from TSA */
>  	tsa_serial_disconnect(qmc->tsa_serial);
> -
> -	return 0;
>  }
>  
>  static const struct of_device_id qmc_id_table[] = {
> @@ -1443,7 +1441,7 @@ static struct platform_driver qmc_driver = {
>  		.of_match_table = of_match_ptr(qmc_id_table),
>  	},
>  	.probe = qmc_probe,
> -	.remove = qmc_remove,
> +	.remove_new = qmc_remove,
>  };
>  module_platform_driver(qmc_driver);
>  

Acked-by: Herve Codina <herve.codina@bootlin.com>

Best regards,
Hervé

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: (subset) [PATCH 31/40] soc/samsung: exynos-chipid: Convert to platform remove callback returning void
  2023-09-25  9:55 ` [PATCH 31/40] soc/samsung: exynos-chipid: " Uwe Kleine-König
@ 2023-09-28  5:52   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2023-09-28  5:52 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Krzysztof Kozlowski, Alim Akhtar, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, kernel


On Mon, 25 Sep 2023 11:55:22 +0200, 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> [...]

Applied, thanks!

[31/40] soc/samsung: exynos-chipid: Convert to platform remove callback returning void
        https://git.kernel.org/krzk/linux/c/0da7c05d232dc015ab421771bb71cdbfb46e0d67

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 30/40] soc/rockchip: io-domain: Convert to platform remove callback returning void
  2023-09-25  9:55 ` [PATCH 30/40] soc/rockchip: io-domain: " Uwe Kleine-König
@ 2023-10-01 22:58   ` Heiko Stuebner
  0 siblings, 0 replies; 30+ messages in thread
From: Heiko Stuebner @ 2023-10-01 22:58 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-arm-kernel, linux-rockchip, linux-kernel, kernel

Am Montag, 25. September 2023, 11:55:21 CEST schrieb Uwe Kleine-König:
> 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

applied for 6.7

Thanks
Heiko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 40/40] soc/xilinx: zynqmp_power: Convert to platform remove callback returning void
  2023-09-25  9:55 ` [PATCH 40/40] soc/xilinx: zynqmp_power: " Uwe Kleine-König
@ 2023-10-02  9:13   ` Michal Simek
  0 siblings, 0 replies; 30+ messages in thread
From: Michal Simek @ 2023-10-02  9:13 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Rob Herring, Ruan Jinjie, Arnd Bergmann, linux-arm-kernel,
	linux-kernel, kernel



On 9/25/23 11:55, 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> 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/soc/xilinx/zynqmp_power.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
> index c2c819701eec..9d27f850f491 100644
> --- a/drivers/soc/xilinx/zynqmp_power.c
> +++ b/drivers/soc/xilinx/zynqmp_power.c
> @@ -275,7 +275,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
>   	return 0;
>   }
>   
> -static int zynqmp_pm_remove(struct platform_device *pdev)
> +static void zynqmp_pm_remove(struct platform_device *pdev)
>   {
>   	sysfs_remove_file(&pdev->dev.kobj, &dev_attr_suspend_mode.attr);
>   	if (event_registered)
> @@ -283,8 +283,6 @@ static int zynqmp_pm_remove(struct platform_device *pdev)
>   
>   	if (!rx_chan)
>   		mbox_free_channel(rx_chan);
> -
> -	return 0;
>   }
>   
>   static const struct of_device_id pm_of_match[] = {
> @@ -295,7 +293,7 @@ MODULE_DEVICE_TABLE(of, pm_of_match);
>   
>   static struct platform_driver zynqmp_pm_platform_driver = {
>   	.probe = zynqmp_pm_probe,
> -	.remove = zynqmp_pm_remove,
> +	.remove_new = zynqmp_pm_remove,
>   	.driver = {
>   		.name = "zynqmp_power",
>   		.of_match_table = pm_of_match,

Applied only this patch.
Thanks,
Michal

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-10-02  9:14 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230925095532.1984344-1-u.kleine-koenig@pengutronix.de>
2023-09-25  9:54 ` [PATCH 01/40] soc/aspeed: aspeed-lpc-ctrl: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-26  1:33   ` Andrew Jeffery
2023-09-25  9:54 ` [PATCH 02/40] soc/aspeed: aspeed-lpc-snoop: " Uwe Kleine-König
2023-09-26  1:30   ` Andrew Jeffery
2023-09-25  9:54 ` [PATCH 03/40] soc/aspeed: aspeed-p2a-ctrl: " Uwe Kleine-König
2023-09-26  1:32   ` Andrew Jeffery
2023-09-25  9:54 ` [PATCH 04/40] soc/aspeed: aspeed-uart-routing: " Uwe Kleine-König
2023-09-26  1:31   ` Andrew Jeffery
2023-09-25  9:54 ` [PATCH 05/40] soc/fsl: dpaa2-console: " Uwe Kleine-König
2023-09-25  9:54 ` [PATCH 06/40] soc/fsl: cpm: qmc: " Uwe Kleine-König
2023-09-27  6:44   ` Herve Codina
2023-09-25  9:54 ` [PATCH 07/40] soc/fsl: cpm: tsa: " Uwe Kleine-König
2023-09-27  6:44   ` Herve Codina
2023-09-25  9:55 ` [PATCH 14/40] soc/mediatek: mtk-devapc: " Uwe Kleine-König
2023-09-26  9:23   ` AngeloGioacchino Del Regno
2023-09-25  9:55 ` [PATCH 15/40] soc/mediatek: mtk-mmsys: " Uwe Kleine-König
2023-09-26  9:23   ` AngeloGioacchino Del Regno
2023-09-25  9:55 ` [PATCH 30/40] soc/rockchip: io-domain: " Uwe Kleine-König
2023-10-01 22:58   ` Heiko Stuebner
2023-09-25  9:55 ` [PATCH 31/40] soc/samsung: exynos-chipid: " Uwe Kleine-König
2023-09-28  5:52   ` (subset) " Krzysztof Kozlowski
2023-09-25  9:55 ` [PATCH 33/40] soc/ti: k3-ringacc: " Uwe Kleine-König
2023-09-25  9:55 ` [PATCH 34/40] soc/ti: knav_dma: " Uwe Kleine-König
2023-09-25  9:55 ` [PATCH 35/40] soc/ti: knav_qmss_queue: " Uwe Kleine-König
2023-09-25  9:55 ` [PATCH 36/40] soc/ti: pm33xx: " Uwe Kleine-König
2023-09-25  9:55 ` [PATCH 37/40] soc/ti: pruss: " Uwe Kleine-König
2023-09-25  9:55 ` [PATCH 38/40] soc/ti: smartreflex: " Uwe Kleine-König
2023-09-25  9:55 ` [PATCH 39/40] soc/ti: wkup_m3_ipc: " Uwe Kleine-König
2023-09-25  9:55 ` [PATCH 40/40] soc/xilinx: zynqmp_power: " Uwe Kleine-König
2023-10-02  9:13   ` Michal Simek

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