linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 02/59] dma: apple-admac: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 03/59] dma: at_hdmac: " Uwe Kleine-König
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, asahi,
	linux-arm-kernel, dmaengine, 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() is 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/dma/apple-admac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c
index 3af795635c5c..46bb02858561 100644
--- a/drivers/dma/apple-admac.c
+++ b/drivers/dma/apple-admac.c
@@ -925,7 +925,7 @@ static int admac_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int admac_remove(struct platform_device *pdev)
+static void admac_remove(struct platform_device *pdev)
 {
 	struct admac_data *ad = platform_get_drvdata(pdev);
 
@@ -933,8 +933,6 @@ static int admac_remove(struct platform_device *pdev)
 	dma_async_device_unregister(&ad->dma);
 	free_irq(ad->irq, ad);
 	reset_control_rearm(ad->rstc);
-
-	return 0;
 }
 
 static const struct of_device_id admac_of_match[] = {
@@ -949,7 +947,7 @@ static struct platform_driver apple_admac_driver = {
 		.of_match_table = admac_of_match,
 	},
 	.probe = admac_probe,
-	.remove = admac_remove,
+	.remove_new = admac_remove,
 };
 module_platform_driver(apple_admac_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] 28+ messages in thread

* [PATCH 03/59] dma: at_hdmac: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
  2023-09-19 13:31 ` [PATCH 02/59] dma: apple-admac: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 04/59] dma: at_xdmac: " Uwe Kleine-König
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Ludovic Desroches, Tudor Ambarus, linux-arm-kernel, dmaengine,
	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() is 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/dma/at_hdmac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index b2876f67471f..417a9428a9b6 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -2100,7 +2100,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int at_dma_remove(struct platform_device *pdev)
+static void at_dma_remove(struct platform_device *pdev)
 {
 	struct at_dma		*atdma = platform_get_drvdata(pdev);
 	struct dma_chan		*chan, *_chan;
@@ -2122,8 +2122,6 @@ static int at_dma_remove(struct platform_device *pdev)
 	}
 
 	clk_disable_unprepare(atdma->clk);
-
-	return 0;
 }
 
 static void at_dma_shutdown(struct platform_device *pdev)
@@ -2242,7 +2240,7 @@ static const struct dev_pm_ops __maybe_unused at_dma_dev_pm_ops = {
 };
 
 static struct platform_driver at_dma_driver = {
-	.remove		= at_dma_remove,
+	.remove_new	= at_dma_remove,
 	.shutdown	= at_dma_shutdown,
 	.id_table	= atdma_devtypes,
 	.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] 28+ messages in thread

* [PATCH 04/59] dma: at_xdmac: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
  2023-09-19 13:31 ` [PATCH 02/59] dma: apple-admac: Convert to platform remove callback returning void Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 03/59] dma: at_hdmac: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 06/59] dma: bcm2835-dma: " Uwe Kleine-König
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Ludovic Desroches, Tudor Ambarus, linux-arm-kernel, dmaengine,
	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() is 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/dma/at_xdmac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index c3b37168b21f..299396121e6d 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -2431,7 +2431,7 @@ static int at_xdmac_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int at_xdmac_remove(struct platform_device *pdev)
+static void at_xdmac_remove(struct platform_device *pdev)
 {
 	struct at_xdmac	*atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev);
 	int		i;
@@ -2452,8 +2452,6 @@ static int at_xdmac_remove(struct platform_device *pdev)
 		tasklet_kill(&atchan->tasklet);
 		at_xdmac_free_chan_resources(&atchan->chan);
 	}
-
-	return 0;
 }
 
 static const struct dev_pm_ops __maybe_unused atmel_xdmac_dev_pm_ops = {
@@ -2478,7 +2476,7 @@ MODULE_DEVICE_TABLE(of, atmel_xdmac_dt_ids);
 
 static struct platform_driver at_xdmac_driver = {
 	.probe		= at_xdmac_probe,
-	.remove		= at_xdmac_remove,
+	.remove_new	= at_xdmac_remove,
 	.driver = {
 		.name		= "at_xdmac",
 		.of_match_table	= of_match_ptr(atmel_xdmac_dt_ids),
-- 
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] 28+ messages in thread

* [PATCH 06/59] dma: bcm2835-dma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (2 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 04/59] dma: at_xdmac: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 18/59] dma: imx-dma: " Uwe Kleine-König
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, dmaengine, linux-rpi-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() is 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/dma/bcm2835-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
index 0807fb9eb262..9d74fe97452e 100644
--- a/drivers/dma/bcm2835-dma.c
+++ b/drivers/dma/bcm2835-dma.c
@@ -1019,19 +1019,17 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static int bcm2835_dma_remove(struct platform_device *pdev)
+static void bcm2835_dma_remove(struct platform_device *pdev)
 {
 	struct bcm2835_dmadev *od = platform_get_drvdata(pdev);
 
 	dma_async_device_unregister(&od->ddev);
 	bcm2835_dma_free(od);
-
-	return 0;
 }
 
 static struct platform_driver bcm2835_dma_driver = {
 	.probe	= bcm2835_dma_probe,
-	.remove	= bcm2835_dma_remove,
+	.remove_new = bcm2835_dma_remove,
 	.driver = {
 		.name = "bcm2835-dma",
 		.of_match_table = of_match_ptr(bcm2835_dma_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] 28+ messages in thread

* [PATCH 18/59] dma: imx-dma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (3 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 06/59] dma: bcm2835-dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 19/59] dma: imx-sdma: " Uwe Kleine-König
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Shawn Guo, Sascha Hauer, Fabio Estevam, NXP Linux Team, dmaengine,
	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() is 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/dma/imx-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 114f254b9f50..ebf7c115d553 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -1216,7 +1216,7 @@ static void imxdma_free_irq(struct platform_device *pdev, struct imxdma_engine *
 	}
 }
 
-static int imxdma_remove(struct platform_device *pdev)
+static void imxdma_remove(struct platform_device *pdev)
 {
 	struct imxdma_engine *imxdma = platform_get_drvdata(pdev);
 
@@ -1229,8 +1229,6 @@ static int imxdma_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(imxdma->dma_ipg);
 	clk_disable_unprepare(imxdma->dma_ahb);
-
-        return 0;
 }
 
 static struct platform_driver imxdma_driver = {
@@ -1238,7 +1236,7 @@ static struct platform_driver imxdma_driver = {
 		.name	= "imx-dma",
 		.of_match_table = imx_dma_of_dev_id,
 	},
-	.remove		= imxdma_remove,
+	.remove_new	= imxdma_remove,
 };
 
 static int __init imxdma_module_init(void)
-- 
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] 28+ messages in thread

* [PATCH 19/59] dma: imx-sdma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (4 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 18/59] dma: imx-dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 22/59] dma: mediatek: mtk-cqdma: " Uwe Kleine-König
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Shawn Guo, Sascha Hauer, Fabio Estevam, NXP Linux Team, dmaengine,
	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() is 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/dma/imx-sdma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 51012bd39900..f81ecf5863e8 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -2358,7 +2358,7 @@ static int sdma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sdma_remove(struct platform_device *pdev)
+static void sdma_remove(struct platform_device *pdev)
 {
 	struct sdma_engine *sdma = platform_get_drvdata(pdev);
 	int i;
@@ -2377,7 +2377,6 @@ static int sdma_remove(struct platform_device *pdev)
 	}
 
 	platform_set_drvdata(pdev, NULL);
-	return 0;
 }
 
 static struct platform_driver sdma_driver = {
@@ -2385,7 +2384,7 @@ static struct platform_driver sdma_driver = {
 		.name	= "imx-sdma",
 		.of_match_table = sdma_dt_ids,
 	},
-	.remove		= sdma_remove,
+	.remove_new	= sdma_remove,
 	.probe		= sdma_probe,
 };
 
-- 
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] 28+ messages in thread

* [PATCH 22/59] dma: mediatek: mtk-cqdma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (5 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 19/59] dma: imx-sdma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-20 10:28   ` AngeloGioacchino Del Regno
  2023-09-19 13:31 ` [PATCH 23/59] dma: mediatek: mtk-hsdma: " Uwe Kleine-König
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno,
	dmaengine, 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() is 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/dma/mediatek/mtk-cqdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mediatek/mtk-cqdma.c b/drivers/dma/mediatek/mtk-cqdma.c
index 324b7387b1b9..529100c5b9f5 100644
--- a/drivers/dma/mediatek/mtk-cqdma.c
+++ b/drivers/dma/mediatek/mtk-cqdma.c
@@ -885,7 +885,7 @@ static int mtk_cqdma_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int mtk_cqdma_remove(struct platform_device *pdev)
+static void mtk_cqdma_remove(struct platform_device *pdev)
 {
 	struct mtk_cqdma_device *cqdma = platform_get_drvdata(pdev);
 	struct mtk_cqdma_vchan *vc;
@@ -918,13 +918,11 @@ static int mtk_cqdma_remove(struct platform_device *pdev)
 
 	dma_async_device_unregister(&cqdma->ddev);
 	of_dma_controller_free(pdev->dev.of_node);
-
-	return 0;
 }
 
 static struct platform_driver mtk_cqdma_driver = {
 	.probe = mtk_cqdma_probe,
-	.remove = mtk_cqdma_remove,
+	.remove_new = mtk_cqdma_remove,
 	.driver = {
 		.name           = KBUILD_MODNAME,
 		.of_match_table = mtk_cqdma_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] 28+ messages in thread

* [PATCH 23/59] dma: mediatek: mtk-hsdma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (6 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 22/59] dma: mediatek: mtk-cqdma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-20 10:28   ` AngeloGioacchino Del Regno
  2023-09-19 13:31 ` [PATCH 24/59] dma: mediatek: mtk-uart-apdma: " Uwe Kleine-König
                   ` (10 subsequent siblings)
  18 siblings, 1 reply; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno,
	dmaengine, 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() is 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/dma/mediatek/mtk-hsdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
index 64120767d983..36ff11e909ea 100644
--- a/drivers/dma/mediatek/mtk-hsdma.c
+++ b/drivers/dma/mediatek/mtk-hsdma.c
@@ -1009,7 +1009,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int mtk_hsdma_remove(struct platform_device *pdev)
+static void mtk_hsdma_remove(struct platform_device *pdev)
 {
 	struct mtk_hsdma_device *hsdma = platform_get_drvdata(pdev);
 	struct mtk_hsdma_vchan *vc;
@@ -1034,13 +1034,11 @@ static int mtk_hsdma_remove(struct platform_device *pdev)
 
 	dma_async_device_unregister(&hsdma->ddev);
 	of_dma_controller_free(pdev->dev.of_node);
-
-	return 0;
 }
 
 static struct platform_driver mtk_hsdma_driver = {
 	.probe		= mtk_hsdma_probe,
-	.remove		= mtk_hsdma_remove,
+	.remove_new	= mtk_hsdma_remove,
 	.driver = {
 		.name		= KBUILD_MODNAME,
 		.of_match_table	= mtk_hsdma_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] 28+ messages in thread

* [PATCH 24/59] dma: mediatek: mtk-uart-apdma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (7 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 23/59] dma: mediatek: mtk-hsdma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-20 10:28   ` AngeloGioacchino Del Regno
  2023-09-19 13:31 ` [PATCH 31/59] dma: owl-dma: " Uwe Kleine-König
                   ` (9 subsequent siblings)
  18 siblings, 1 reply; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno,
	dmaengine, 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() is 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/dma/mediatek/mtk-uart-apdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mediatek/mtk-uart-apdma.c b/drivers/dma/mediatek/mtk-uart-apdma.c
index c51dc017b48a..8552531b4d64 100644
--- a/drivers/dma/mediatek/mtk-uart-apdma.c
+++ b/drivers/dma/mediatek/mtk-uart-apdma.c
@@ -573,7 +573,7 @@ static int mtk_uart_apdma_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static int mtk_uart_apdma_remove(struct platform_device *pdev)
+static void mtk_uart_apdma_remove(struct platform_device *pdev)
 {
 	struct mtk_uart_apdmadev *mtkd = platform_get_drvdata(pdev);
 
@@ -584,8 +584,6 @@ static int mtk_uart_apdma_remove(struct platform_device *pdev)
 	dma_async_device_unregister(&mtkd->ddev);
 
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -640,7 +638,7 @@ static const struct dev_pm_ops mtk_uart_apdma_pm_ops = {
 
 static struct platform_driver mtk_uart_apdma_driver = {
 	.probe	= mtk_uart_apdma_probe,
-	.remove	= mtk_uart_apdma_remove,
+	.remove_new = mtk_uart_apdma_remove,
 	.driver = {
 		.name		= KBUILD_MODNAME,
 		.pm		= &mtk_uart_apdma_pm_ops,
-- 
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] 28+ messages in thread

* [PATCH 31/59] dma: owl-dma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (8 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 24/59] dma: mediatek: mtk-uart-apdma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 33/59] dma: pxa_dma: " Uwe Kleine-König
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andreas Färber, Manivannan Sadhasivam, dmaengine,
	linux-arm-kernel, linux-actions, 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() is 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/dma/owl-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c
index 384476757c5e..4e76c4ec2d39 100644
--- a/drivers/dma/owl-dma.c
+++ b/drivers/dma/owl-dma.c
@@ -1231,7 +1231,7 @@ static int owl_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int owl_dma_remove(struct platform_device *pdev)
+static void owl_dma_remove(struct platform_device *pdev)
 {
 	struct owl_dma *od = platform_get_drvdata(pdev);
 
@@ -1248,13 +1248,11 @@ static int owl_dma_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(od->clk);
 	dma_pool_destroy(od->lli_pool);
-
-	return 0;
 }
 
 static struct platform_driver owl_dma_driver = {
 	.probe	= owl_dma_probe,
-	.remove	= owl_dma_remove,
+	.remove_new = owl_dma_remove,
 	.driver = {
 		.name = "dma-owl",
 		.of_match_table = of_match_ptr(owl_dma_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] 28+ messages in thread

* [PATCH 33/59] dma: pxa_dma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (9 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 31/59] dma: owl-dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 35/59] dma: qcom: hidma: " Uwe Kleine-König
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, linux-arm-kernel,
	dmaengine, 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() is 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/dma/pxa_dma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c
index 1b046d9a3a26..3c574dc0613b 100644
--- a/drivers/dma/pxa_dma.c
+++ b/drivers/dma/pxa_dma.c
@@ -1221,13 +1221,12 @@ static void pxad_free_channels(struct dma_device *dmadev)
 	}
 }
 
-static int pxad_remove(struct platform_device *op)
+static void pxad_remove(struct platform_device *op)
 {
 	struct pxad_device *pdev = platform_get_drvdata(op);
 
 	pxad_cleanup_debugfs(pdev);
 	pxad_free_channels(&pdev->slave);
-	return 0;
 }
 
 static int pxad_init_phys(struct platform_device *op,
@@ -1444,7 +1443,7 @@ static struct platform_driver pxad_driver = {
 	},
 	.id_table	= pxad_id_table,
 	.probe		= pxad_probe,
-	.remove		= pxad_remove,
+	.remove_new	= pxad_remove,
 };
 
 static bool pxad_filter_fn(struct dma_chan *chan, void *param)
-- 
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] 28+ messages in thread

* [PATCH 35/59] dma: qcom: hidma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (10 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 33/59] dma: pxa_dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 21:02   ` Konrad Dybcio
  2023-09-19 13:31 ` [PATCH 44/59] dma: st_fdma: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  18 siblings, 1 reply; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Sinan Kaya, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	linux-arm-kernel, linux-arm-msm, dmaengine, 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() is 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/dma/qcom/hidma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
index 834ae519c15d..f4659553945b 100644
--- a/drivers/dma/qcom/hidma.c
+++ b/drivers/dma/qcom/hidma.c
@@ -915,7 +915,7 @@ static void hidma_shutdown(struct platform_device *pdev)
 
 }
 
-static int hidma_remove(struct platform_device *pdev)
+static void hidma_remove(struct platform_device *pdev)
 {
 	struct hidma_dev *dmadev = platform_get_drvdata(pdev);
 
@@ -935,8 +935,6 @@ static int hidma_remove(struct platform_device *pdev)
 	dev_info(&pdev->dev, "HI-DMA engine removed\n");
 	pm_runtime_put_sync_suspend(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 #if IS_ENABLED(CONFIG_ACPI)
@@ -960,7 +958,7 @@ MODULE_DEVICE_TABLE(of, hidma_match);
 
 static struct platform_driver hidma_driver = {
 	.probe = hidma_probe,
-	.remove = hidma_remove,
+	.remove_new = hidma_remove,
 	.shutdown = hidma_shutdown,
 	.driver = {
 		   .name = "hidma",
-- 
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] 28+ messages in thread

* [PATCH 44/59] dma: st_fdma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (11 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 35/59] dma: qcom: hidma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 45/59] dma: sun4i-dma: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Patrice Chotard, linux-arm-kernel, dmaengine, 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() is 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/dma/st_fdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c
index d95c421877fb..145bd0f2496e 100644
--- a/drivers/dma/st_fdma.c
+++ b/drivers/dma/st_fdma.c
@@ -849,15 +849,13 @@ static int st_fdma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int st_fdma_remove(struct platform_device *pdev)
+static void st_fdma_remove(struct platform_device *pdev)
 {
 	struct st_fdma_dev *fdev = platform_get_drvdata(pdev);
 
 	devm_free_irq(&pdev->dev, fdev->irq, fdev);
 	st_slim_rproc_put(fdev->slim_rproc);
 	of_dma_controller_free(pdev->dev.of_node);
-
-	return 0;
 }
 
 static struct platform_driver st_fdma_platform_driver = {
@@ -866,7 +864,7 @@ static struct platform_driver st_fdma_platform_driver = {
 		.of_match_table = st_fdma_match,
 	},
 	.probe = st_fdma_probe,
-	.remove = st_fdma_remove,
+	.remove_new = st_fdma_remove,
 };
 module_platform_driver(st_fdma_platform_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] 28+ messages in thread

* [PATCH 45/59] dma: sun4i-dma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (12 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 44/59] dma: st_fdma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 17:21   ` Jernej Škrabec
  2023-09-19 13:31 ` [PATCH 46/59] dma: sun6i-dma: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  18 siblings, 1 reply; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, dmaengine,
	linux-arm-kernel, linux-sunxi, 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() is 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/dma/sun4i-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c
index e86c8829513a..2e7f9b07fdd2 100644
--- a/drivers/dma/sun4i-dma.c
+++ b/drivers/dma/sun4i-dma.c
@@ -1271,7 +1271,7 @@ static int sun4i_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sun4i_dma_remove(struct platform_device *pdev)
+static void sun4i_dma_remove(struct platform_device *pdev)
 {
 	struct sun4i_dma_dev *priv = platform_get_drvdata(pdev);
 
@@ -1282,8 +1282,6 @@ static int sun4i_dma_remove(struct platform_device *pdev)
 	dma_async_device_unregister(&priv->slave);
 
 	clk_disable_unprepare(priv->clk);
-
-	return 0;
 }
 
 static const struct of_device_id sun4i_dma_match[] = {
@@ -1294,7 +1292,7 @@ MODULE_DEVICE_TABLE(of, sun4i_dma_match);
 
 static struct platform_driver sun4i_dma_driver = {
 	.probe	= sun4i_dma_probe,
-	.remove	= sun4i_dma_remove,
+	.remove_new = sun4i_dma_remove,
 	.driver	= {
 		.name		= "sun4i-dma",
 		.of_match_table	= sun4i_dma_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] 28+ messages in thread

* [PATCH 46/59] dma: sun6i-dma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (13 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 45/59] dma: sun4i-dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 17:22   ` Jernej Škrabec
  2023-09-19 13:32 ` [PATCH 56/59] dma: xilinx: xdma: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  18 siblings, 1 reply; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, dmaengine,
	linux-arm-kernel, linux-sunxi, 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() is 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/dma/sun6i-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index 2469efddf540..583bf49031cf 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -1470,7 +1470,7 @@ static int sun6i_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sun6i_dma_remove(struct platform_device *pdev)
+static void sun6i_dma_remove(struct platform_device *pdev)
 {
 	struct sun6i_dma_dev *sdc = platform_get_drvdata(pdev);
 
@@ -1484,13 +1484,11 @@ static int sun6i_dma_remove(struct platform_device *pdev)
 	reset_control_assert(sdc->rstc);
 
 	sun6i_dma_free(sdc);
-
-	return 0;
 }
 
 static struct platform_driver sun6i_dma_driver = {
 	.probe		= sun6i_dma_probe,
-	.remove		= sun6i_dma_remove,
+	.remove_new	= sun6i_dma_remove,
 	.driver = {
 		.name		= "sun6i-dma",
 		.of_match_table	= sun6i_dma_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] 28+ messages in thread

* [PATCH 56/59] dma: xilinx: xdma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (14 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 46/59] dma: sun6i-dma: " Uwe Kleine-König
@ 2023-09-19 13:32 ` Uwe Kleine-König
  2023-09-19 13:32 ` [PATCH 57/59] dma: xilinx: xilinx_dma: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:32 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Lizhi Hou, Brian Xu, Raj Kumar Rampelli, Michal Simek, dmaengine,
	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() is 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/dma/xilinx/xdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
index e0bfd129d563..459e7b9838ed 100644
--- a/drivers/dma/xilinx/xdma.c
+++ b/drivers/dma/xilinx/xdma.c
@@ -841,7 +841,7 @@ EXPORT_SYMBOL(xdma_get_user_irq);
  * xdma_remove - Driver remove function
  * @pdev: Pointer to the platform_device structure
  */
-static int xdma_remove(struct platform_device *pdev)
+static void xdma_remove(struct platform_device *pdev)
 {
 	struct xdma_device *xdev = platform_get_drvdata(pdev);
 
@@ -850,8 +850,6 @@ static int xdma_remove(struct platform_device *pdev)
 
 	if (xdev->status & XDMA_DEV_STATUS_REG_DMA)
 		dma_async_device_unregister(&xdev->dma_dev);
-
-	return 0;
 }
 
 /**
@@ -966,7 +964,7 @@ static struct platform_driver xdma_driver = {
 	},
 	.id_table	= xdma_id_table,
 	.probe		= xdma_probe,
-	.remove		= xdma_remove,
+	.remove_new	= xdma_remove,
 };
 
 module_platform_driver(xdma_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] 28+ messages in thread

* [PATCH 57/59] dma: xilinx: xilinx_dma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (15 preceding siblings ...)
  2023-09-19 13:32 ` [PATCH 56/59] dma: xilinx: xdma: " Uwe Kleine-König
@ 2023-09-19 13:32 ` Uwe Kleine-König
  2023-09-22 11:36   ` Pandey, Radhey Shyam
  2023-09-19 13:32 ` [PATCH 58/59] dma: xilinx: xilinx_dpdma: " Uwe Kleine-König
  2023-09-19 13:32 ` [PATCH 59/59] dma: xilinx: zynqmp_dma: " Uwe Kleine-König
  18 siblings, 1 reply; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:32 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Michal Simek, Radhey Shyam Pandey, Rob Herring, Peter Korsgaard,
	Liu Shixin, dmaengine, 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() is 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/dma/xilinx/xilinx_dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 0a3b2e22f23d..0c363a1ed853 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -3245,7 +3245,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
  *
  * Return: Always '0'
  */
-static int xilinx_dma_remove(struct platform_device *pdev)
+static void xilinx_dma_remove(struct platform_device *pdev)
 {
 	struct xilinx_dma_device *xdev = platform_get_drvdata(pdev);
 	int i;
@@ -3259,8 +3259,6 @@ static int xilinx_dma_remove(struct platform_device *pdev)
 			xilinx_dma_chan_remove(xdev->chan[i]);
 
 	xdma_disable_allclks(xdev);
-
-	return 0;
 }
 
 static struct platform_driver xilinx_vdma_driver = {
@@ -3269,7 +3267,7 @@ static struct platform_driver xilinx_vdma_driver = {
 		.of_match_table = xilinx_dma_of_ids,
 	},
 	.probe = xilinx_dma_probe,
-	.remove = xilinx_dma_remove,
+	.remove_new = xilinx_dma_remove,
 };
 
 module_platform_driver(xilinx_vdma_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] 28+ messages in thread

* [PATCH 58/59] dma: xilinx: xilinx_dpdma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (16 preceding siblings ...)
  2023-09-19 13:32 ` [PATCH 57/59] dma: xilinx: xilinx_dma: " Uwe Kleine-König
@ 2023-09-19 13:32 ` Uwe Kleine-König
  2023-09-19 13:32 ` [PATCH 59/59] dma: xilinx: zynqmp_dma: " Uwe Kleine-König
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:32 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Laurent Pinchart, Michal Simek, dmaengine, 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() is 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/dma/xilinx/xilinx_dpdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c
index 84dc5240a807..69587d85a7cd 100644
--- a/drivers/dma/xilinx/xilinx_dpdma.c
+++ b/drivers/dma/xilinx/xilinx_dpdma.c
@@ -1736,7 +1736,7 @@ static int xilinx_dpdma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int xilinx_dpdma_remove(struct platform_device *pdev)
+static void xilinx_dpdma_remove(struct platform_device *pdev)
 {
 	struct xilinx_dpdma_device *xdev = platform_get_drvdata(pdev);
 	unsigned int i;
@@ -1751,8 +1751,6 @@ static int xilinx_dpdma_remove(struct platform_device *pdev)
 
 	for (i = 0; i < ARRAY_SIZE(xdev->chan); i++)
 		xilinx_dpdma_chan_remove(xdev->chan[i]);
-
-	return 0;
 }
 
 static const struct of_device_id xilinx_dpdma_of_match[] = {
@@ -1763,7 +1761,7 @@ MODULE_DEVICE_TABLE(of, xilinx_dpdma_of_match);
 
 static struct platform_driver xilinx_dpdma_driver = {
 	.probe			= xilinx_dpdma_probe,
-	.remove			= xilinx_dpdma_remove,
+	.remove_new		= xilinx_dpdma_remove,
 	.driver			= {
 		.name		= "xilinx-zynqmp-dpdma",
 		.of_match_table	= xilinx_dpdma_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] 28+ messages in thread

* [PATCH 59/59] dma: xilinx: zynqmp_dma: Convert to platform remove callback returning void
       [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
                   ` (17 preceding siblings ...)
  2023-09-19 13:32 ` [PATCH 58/59] dma: xilinx: xilinx_dpdma: " Uwe Kleine-König
@ 2023-09-19 13:32 ` Uwe Kleine-König
  18 siblings, 0 replies; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:32 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Michal Simek, Peter Ujfalusi, Rob Herring, Harini Katakam,
	Swati Agarwal, Tudor Ambarus, dmaengine, 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() is 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/dma/xilinx/zynqmp_dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index bd8c3cc2eaab..f31631bef961 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -1147,7 +1147,7 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
  *
  * Return: Always '0'
  */
-static int zynqmp_dma_remove(struct platform_device *pdev)
+static void zynqmp_dma_remove(struct platform_device *pdev)
 {
 	struct zynqmp_dma_device *zdev = platform_get_drvdata(pdev);
 
@@ -1158,8 +1158,6 @@ static int zynqmp_dma_remove(struct platform_device *pdev)
 	pm_runtime_disable(zdev->dev);
 	if (!pm_runtime_enabled(zdev->dev))
 		zynqmp_dma_runtime_suspend(zdev->dev);
-
-	return 0;
 }
 
 static const struct of_device_id zynqmp_dma_of_match[] = {
@@ -1175,7 +1173,7 @@ static struct platform_driver zynqmp_dma_driver = {
 		.pm = &zynqmp_dma_dev_pm_ops,
 	},
 	.probe = zynqmp_dma_probe,
-	.remove = zynqmp_dma_remove,
+	.remove_new = zynqmp_dma_remove,
 };
 
 module_platform_driver(zynqmp_dma_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] 28+ messages in thread

* Re: [PATCH 45/59] dma: sun4i-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 45/59] dma: sun4i-dma: " Uwe Kleine-König
@ 2023-09-19 17:21   ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2023-09-19 17:21 UTC (permalink / raw)
  To: Vinod Koul, Uwe Kleine-König
  Cc: Chen-Yu Tsai, Samuel Holland, dmaengine, linux-arm-kernel,
	linux-sunxi, kernel

Dne torek, 19. september 2023 ob 15:31:53 CEST je Uwe Kleine-König napisal(a):
> 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() is 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>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
>  drivers/dma/sun4i-dma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c
> index e86c8829513a..2e7f9b07fdd2 100644
> --- a/drivers/dma/sun4i-dma.c
> +++ b/drivers/dma/sun4i-dma.c
> @@ -1271,7 +1271,7 @@ static int sun4i_dma_probe(struct platform_device
> *pdev) return ret;
>  }
> 
> -static int sun4i_dma_remove(struct platform_device *pdev)
> +static void sun4i_dma_remove(struct platform_device *pdev)
>  {
>  	struct sun4i_dma_dev *priv = platform_get_drvdata(pdev);
> 
> @@ -1282,8 +1282,6 @@ static int sun4i_dma_remove(struct platform_device
> *pdev) dma_async_device_unregister(&priv->slave);
> 
>  	clk_disable_unprepare(priv->clk);
> -
> -	return 0;
>  }
> 
>  static const struct of_device_id sun4i_dma_match[] = {
> @@ -1294,7 +1292,7 @@ MODULE_DEVICE_TABLE(of, sun4i_dma_match);
> 
>  static struct platform_driver sun4i_dma_driver = {
>  	.probe	= sun4i_dma_probe,
> -	.remove	= sun4i_dma_remove,
> +	.remove_new = sun4i_dma_remove,
>  	.driver	= {
>  		.name		= "sun4i-dma",
>  		.of_match_table	= sun4i_dma_match,





_______________________________________________
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] 28+ messages in thread

* Re: [PATCH 46/59] dma: sun6i-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 46/59] dma: sun6i-dma: " Uwe Kleine-König
@ 2023-09-19 17:22   ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2023-09-19 17:22 UTC (permalink / raw)
  To: Vinod Koul, Uwe Kleine-König
  Cc: Chen-Yu Tsai, Samuel Holland, dmaengine, linux-arm-kernel,
	linux-sunxi, kernel

Dne torek, 19. september 2023 ob 15:31:54 CEST je Uwe Kleine-König napisal(a):
> 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() is 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>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
>  drivers/dma/sun6i-dma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
> index 2469efddf540..583bf49031cf 100644
> --- a/drivers/dma/sun6i-dma.c
> +++ b/drivers/dma/sun6i-dma.c
> @@ -1470,7 +1470,7 @@ static int sun6i_dma_probe(struct platform_device
> *pdev) return ret;
>  }
> 
> -static int sun6i_dma_remove(struct platform_device *pdev)
> +static void sun6i_dma_remove(struct platform_device *pdev)
>  {
>  	struct sun6i_dma_dev *sdc = platform_get_drvdata(pdev);
> 
> @@ -1484,13 +1484,11 @@ static int sun6i_dma_remove(struct platform_device
> *pdev) reset_control_assert(sdc->rstc);
> 
>  	sun6i_dma_free(sdc);
> -
> -	return 0;
>  }
> 
>  static struct platform_driver sun6i_dma_driver = {
>  	.probe		= sun6i_dma_probe,
> -	.remove		= sun6i_dma_remove,
> +	.remove_new	= sun6i_dma_remove,
>  	.driver = {
>  		.name		= "sun6i-dma",
>  		.of_match_table	= sun6i_dma_match,





_______________________________________________
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] 28+ messages in thread

* Re: [PATCH 35/59] dma: qcom: hidma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 35/59] dma: qcom: hidma: " Uwe Kleine-König
@ 2023-09-19 21:02   ` Konrad Dybcio
  0 siblings, 0 replies; 28+ messages in thread
From: Konrad Dybcio @ 2023-09-19 21:02 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Sinan Kaya, Andy Gross, Bjorn Andersson, linux-arm-kernel,
	linux-arm-msm, dmaengine, kernel



On 9/19/23 15:31, 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() is 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: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

_______________________________________________
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] 28+ messages in thread

* Re: [PATCH 24/59] dma: mediatek: mtk-uart-apdma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 24/59] dma: mediatek: mtk-uart-apdma: " Uwe Kleine-König
@ 2023-09-20 10:28   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 28+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-20 10:28 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Sean Wang, Matthias Brugger, dmaengine, linux-arm-kernel,
	linux-mediatek, kernel

Il 19/09/23 15:31, 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() is 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] 28+ messages in thread

* Re: [PATCH 23/59] dma: mediatek: mtk-hsdma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 23/59] dma: mediatek: mtk-hsdma: " Uwe Kleine-König
@ 2023-09-20 10:28   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 28+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-20 10:28 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Sean Wang, Matthias Brugger, dmaengine, linux-arm-kernel,
	linux-mediatek, kernel

Il 19/09/23 15:31, 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() is 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] 28+ messages in thread

* Re: [PATCH 22/59] dma: mediatek: mtk-cqdma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 22/59] dma: mediatek: mtk-cqdma: " Uwe Kleine-König
@ 2023-09-20 10:28   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 28+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-20 10:28 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Sean Wang, Matthias Brugger, dmaengine, linux-arm-kernel,
	linux-mediatek, kernel

Il 19/09/23 15:31, 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() is 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] 28+ messages in thread

* RE: [PATCH 57/59] dma: xilinx: xilinx_dma: Convert to platform remove callback returning void
  2023-09-19 13:32 ` [PATCH 57/59] dma: xilinx: xilinx_dma: " Uwe Kleine-König
@ 2023-09-22 11:36   ` Pandey, Radhey Shyam
  2023-09-28  7:27     ` Uwe Kleine-König
  0 siblings, 1 reply; 28+ messages in thread
From: Pandey, Radhey Shyam @ 2023-09-22 11:36 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Simek, Michal, Rob Herring, Peter Korsgaard, Liu Shixin,
	dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	kernel@pengutronix.de

> -----Original Message-----
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Sent: Tuesday, September 19, 2023 7:02 PM
> To: Vinod Koul <vkoul@kernel.org>
> Cc: Simek, Michal <michal.simek@amd.com>; Pandey, Radhey Shyam
> <radhey.shyam.pandey@amd.com>; Rob Herring <robh@kernel.org>; Peter
> Korsgaard <peter@korsgaard.com>; Liu Shixin <liushixin2@huawei.com>;
> dmaengine@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> kernel@pengutronix.de
> Subject: [PATCH 57/59] dma: xilinx: xilinx_dma: Convert to platform remove
> callback returning void
> 
> 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() is 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/dma/xilinx/xilinx_dma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/xilinx/xilinx_dma.c
> b/drivers/dma/xilinx/xilinx_dma.c index 0a3b2e22f23d..0c363a1ed853
> 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -3245,7 +3245,7 @@ static int xilinx_dma_probe(struct platform_device
> *pdev)
>   *
>   * Return: Always '0'
>   */

Nit - kernel-doc return documentation needs to be updated.

> -static int xilinx_dma_remove(struct platform_device *pdev)
> +static void xilinx_dma_remove(struct platform_device *pdev)
>  {
>  	struct xilinx_dma_device *xdev = platform_get_drvdata(pdev);
>  	int i;
> @@ -3259,8 +3259,6 @@ static int xilinx_dma_remove(struct
> platform_device *pdev)
>  			xilinx_dma_chan_remove(xdev->chan[i]);
> 
>  	xdma_disable_allclks(xdev);
> -
> -	return 0;
>  }
> 
>  static struct platform_driver xilinx_vdma_driver = { @@ -3269,7 +3267,7
> @@ static struct platform_driver xilinx_vdma_driver = {
>  		.of_match_table = xilinx_dma_of_ids,
>  	},
>  	.probe = xilinx_dma_probe,
> -	.remove = xilinx_dma_remove,
> +	.remove_new = xilinx_dma_remove,
>  };
> 
>  module_platform_driver(xilinx_vdma_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	[flat|nested] 28+ messages in thread

* Re: [PATCH 57/59] dma: xilinx: xilinx_dma: Convert to platform remove callback returning void
  2023-09-22 11:36   ` Pandey, Radhey Shyam
@ 2023-09-28  7:27     ` Uwe Kleine-König
  2023-09-28  7:47       ` Vinod Koul
  0 siblings, 1 reply; 28+ messages in thread
From: Uwe Kleine-König @ 2023-09-28  7:27 UTC (permalink / raw)
  To: Pandey, Radhey Shyam
  Cc: Vinod Koul, Rob Herring, Peter Korsgaard, Liu Shixin,
	kernel@pengutronix.de, dmaengine@vger.kernel.org, Simek, Michal,
	linux-arm-kernel@lists.infradead.org


[-- Attachment #1.1: Type: text/plain, Size: 2998 bytes --]

Hello,

On Fri, Sep 22, 2023 at 11:36:50AM +0000, Pandey, Radhey Shyam wrote:
> > -----Original Message-----
> > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > Sent: Tuesday, September 19, 2023 7:02 PM
> > To: Vinod Koul <vkoul@kernel.org>
> > Cc: Simek, Michal <michal.simek@amd.com>; Pandey, Radhey Shyam
> > <radhey.shyam.pandey@amd.com>; Rob Herring <robh@kernel.org>; Peter
> > Korsgaard <peter@korsgaard.com>; Liu Shixin <liushixin2@huawei.com>;
> > dmaengine@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> > kernel@pengutronix.de
> > Subject: [PATCH 57/59] dma: xilinx: xilinx_dma: Convert to platform remove
> > callback returning void
> > 
> > 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() is 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/dma/xilinx/xilinx_dma.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/dma/xilinx/xilinx_dma.c
> > b/drivers/dma/xilinx/xilinx_dma.c index 0a3b2e22f23d..0c363a1ed853
> > 100644
> > --- a/drivers/dma/xilinx/xilinx_dma.c
> > +++ b/drivers/dma/xilinx/xilinx_dma.c
> > @@ -3245,7 +3245,7 @@ static int xilinx_dma_probe(struct platform_device
> > *pdev)
> >   *
> >   * Return: Always '0'
> >   */
> 
> Nit - kernel-doc return documentation needs to be updated.

Good catch, I should add that to my pre-send checks. I fixed it in my
tree, so an eventual v2 will be good. I'll wait a bit before resending.

@Vinod: If you pick up this series, feel free to skip this patch or
fixup with 

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 0c363a1ed853..e40696f6f864 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -3242,8 +3242,6 @@ static int xilinx_dma_probe(struct platform_device *pdev)
 /**
  * xilinx_dma_remove - Driver remove function
  * @pdev: Pointer to the platform_device structure
- *
- * Return: Always '0'
  */
 static void xilinx_dma_remove(struct platform_device *pdev)
 {

or apply as is (in which case I will follow up with a separate patch to
fix this).

Thanks
Uwe

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

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

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
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] 28+ messages in thread

* Re: [PATCH 57/59] dma: xilinx: xilinx_dma: Convert to platform remove callback returning void
  2023-09-28  7:27     ` Uwe Kleine-König
@ 2023-09-28  7:47       ` Vinod Koul
  0 siblings, 0 replies; 28+ messages in thread
From: Vinod Koul @ 2023-09-28  7:47 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Pandey, Radhey Shyam, Rob Herring, Peter Korsgaard, Liu Shixin,
	kernel@pengutronix.de, dmaengine@vger.kernel.org, Simek, Michal,
	linux-arm-kernel@lists.infradead.org

On 28-09-23, 09:27, Uwe Kleine-König wrote:
> 
> Good catch, I should add that to my pre-send checks. I fixed it in my
> tree, so an eventual v2 will be good. I'll wait a bit before resending.
> 
> @Vinod: If you pick up this series, feel free to skip this patch or
> fixup with 
> 
> diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
> index 0c363a1ed853..e40696f6f864 100644
> --- a/drivers/dma/xilinx/xilinx_dma.c
> +++ b/drivers/dma/xilinx/xilinx_dma.c
> @@ -3242,8 +3242,6 @@ static int xilinx_dma_probe(struct platform_device *pdev)
>  /**
>   * xilinx_dma_remove - Driver remove function
>   * @pdev: Pointer to the platform_device structure
> - *
> - * Return: Always '0'
>   */
>  static void xilinx_dma_remove(struct platform_device *pdev)
>  {
> 
> or apply as is (in which case I will follow up with a separate patch to
> fix this).

Follow up patch is easier to handle

Thanks
-- 
~Vinod

_______________________________________________
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] 28+ messages in thread

end of thread, other threads:[~2023-09-28  7:48 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230919133207.1400430-1-u.kleine-koenig@pengutronix.de>
2023-09-19 13:31 ` [PATCH 02/59] dma: apple-admac: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 03/59] dma: at_hdmac: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 04/59] dma: at_xdmac: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 06/59] dma: bcm2835-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 18/59] dma: imx-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 19/59] dma: imx-sdma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 22/59] dma: mediatek: mtk-cqdma: " Uwe Kleine-König
2023-09-20 10:28   ` AngeloGioacchino Del Regno
2023-09-19 13:31 ` [PATCH 23/59] dma: mediatek: mtk-hsdma: " Uwe Kleine-König
2023-09-20 10:28   ` AngeloGioacchino Del Regno
2023-09-19 13:31 ` [PATCH 24/59] dma: mediatek: mtk-uart-apdma: " Uwe Kleine-König
2023-09-20 10:28   ` AngeloGioacchino Del Regno
2023-09-19 13:31 ` [PATCH 31/59] dma: owl-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 33/59] dma: pxa_dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 35/59] dma: qcom: hidma: " Uwe Kleine-König
2023-09-19 21:02   ` Konrad Dybcio
2023-09-19 13:31 ` [PATCH 44/59] dma: st_fdma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 45/59] dma: sun4i-dma: " Uwe Kleine-König
2023-09-19 17:21   ` Jernej Škrabec
2023-09-19 13:31 ` [PATCH 46/59] dma: sun6i-dma: " Uwe Kleine-König
2023-09-19 17:22   ` Jernej Škrabec
2023-09-19 13:32 ` [PATCH 56/59] dma: xilinx: xdma: " Uwe Kleine-König
2023-09-19 13:32 ` [PATCH 57/59] dma: xilinx: xilinx_dma: " Uwe Kleine-König
2023-09-22 11:36   ` Pandey, Radhey Shyam
2023-09-28  7:27     ` Uwe Kleine-König
2023-09-28  7:47       ` Vinod Koul
2023-09-19 13:32 ` [PATCH 58/59] dma: xilinx: xilinx_dpdma: " Uwe Kleine-König
2023-09-19 13:32 ` [PATCH 59/59] dma: xilinx: zynqmp_dma: " Uwe Kleine-König

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