dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/59] dma: Convert to platform remove callback returning void
@ 2023-09-19 13:31 Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 01/59] dma: altera-msgdma: " Uwe Kleine-König
                   ` (60 more replies)
  0 siblings, 61 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Olivier Dautricourt, Stefan Roese, dmaengine, kernel,
	Hector Martin, Sven Peter, Alyssa Rosenzweig, asahi,
	linux-arm-kernel, Ludovic Desroches, Tudor Ambarus,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, linux-rpi-kernel, Rob Herring, Lars-Peter Clausen,
	Paul Cercueil, linux-mips, Eugeniy Paltsev, Viresh Kumar,
	Andy Shevchenko, Li Yang, Zhang Wei, linuxppc-dev, Shawn Guo,
	Sascha Hauer, Fabio Estevam, NXP Linux Team, Sean Wang,
	Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek,
	Andreas Färber, Manivannan Sadhasivam, linux-actions,
	ye xingchen, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Sinan Kaya, Green Wan, Kees Cook, Gustavo A. R. Silva, Biju Das,
	Geert Uytterhoeven, Lad Prabhakar, Pavel Machek, Hien Huynh,
	Yangtao Li, Peter Ujfalusi, Jernej Skrabec, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Patrice Chotard, Chen-Yu Tsai,
	Samuel Holland, linux-sunxi, Laxman Dewangan, Jon Hunter,
	Thierry Reding, linux-tegra, Lizhi Hou, Brian Xu,
	Raj Kumar Rampelli, Michal Simek, Radhey Shyam Pandey,
	Peter Korsgaard, Liu Shixin, Laurent Pinchart, Harini Katakam,
	Swati Agarwal

Hello,

this series convert nearly all platform drivers below drivers/dma to use
.remove_new(). The motivation is to get rid of an integer return code
that is (mostly) ignored by the platform driver core and error prone on
the driver side.

See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.

There are 4 drivers I didn't convert in this series:

	drivers/dma/milbeaut-hdmac.c
	drivers/dma/milbeaut-xdmac.c
	drivers/dma/uniphier-mdmac.c
	drivers/dma/uniphier-xdmac.c

These all might return early in .remove() if dmaengine_terminate_sync()
fails. I only looked deeper into the first one, and this shows exactly
the error that is easy to make with .remove() returning an int: When
returning early from .remove(), some cleanup (here:
dma_async_device_unregister()) is skipped. So the dma device stays
known, but the device is still unregistered and the devm allocated stuff
(here e.g. *mdev) is freed. So it can probably easily happen, that
something tries to use the dma device and this will likely result in an
oops.

I don't know enough about the dma framework to address this properly,
maybe someone else knows what to do?

There are no interdependencies between the patches. As there are still
quite a few drivers to convert, I'm happy about every patch that makes
it in. So even if there is a merge conflict with one patch until you
apply or I picked a wrong subject prefix, please apply the remainder of
this series anyhow.

Best regards
Uwe


Uwe Kleine-König (59):
  dma: altera-msgdma: Convert to platform remove callback returning void
  dma: apple-admac: Convert to platform remove callback returning void
  dma: at_hdmac: Convert to platform remove callback returning void
  dma: at_xdmac: Convert to platform remove callback returning void
  dma: bcm-sba-raid: Convert to platform remove callback returning void
  dma: bcm2835-dma: Convert to platform remove callback returning void
  dma: bestcomm: bestcomm: Convert to platform remove callback returning
    void
  dma: dma-axi-dmac: Convert to platform remove callback returning void
  dma: dma-jz4780: Convert to platform remove callback returning void
  dma: dw-axi-dmac: dw-axi-dmac-platform: Convert to platform remove
    callback returning void
  dma: dw: platform: Convert to platform remove callback returning void
  dma: fsl-edma-main: Convert to platform remove callback returning void
  dma: fsl-qdma: Convert to platform remove callback returning void
  dma: fsl_raid: Convert to platform remove callback returning void
  dma: fsldma: Convert to platform remove callback returning void
  dma: idma64: Convert to platform remove callback returning void
  dma: img-mdc-dma: Convert to platform remove callback returning void
  dma: imx-dma: Convert to platform remove callback returning void
  dma: imx-sdma: Convert to platform remove callback returning void
  dma: k3dma: Convert to platform remove callback returning void
  dma: mcf-edma-main: Convert to platform remove callback returning void
  dma: mediatek: mtk-cqdma: Convert to platform remove callback
    returning void
  dma: mediatek: mtk-hsdma: Convert to platform remove callback
    returning void
  dma: mediatek: mtk-uart-apdma: Convert to platform remove callback
    returning void
  dma: mmp_pdma: Convert to platform remove callback returning void
  dma: mmp_tdma: Convert to platform remove callback returning void
  dma: moxart-dma: Convert to platform remove callback returning void
  dma: mpc512x_dma: Convert to platform remove callback returning void
  dma: mv_xor_v2: Convert to platform remove callback returning void
  dma: nbpfaxi: Convert to platform remove callback returning void
  dma: owl-dma: Convert to platform remove callback returning void
  dma: ppc4xx: adma: Convert to platform remove callback returning void
  dma: pxa_dma: Convert to platform remove callback returning void
  dma: qcom: bam_dma: Convert to platform remove callback returning void
  dma: qcom: hidma: Convert to platform remove callback returning void
  dma: qcom: qcom_adm: Convert to platform remove callback returning
    void
  dma: sa11x0-dma: Convert to platform remove callback returning void
  dma: sf-pdma: sf-pdma: Convert to platform remove callback returning
    void
  dma: sh: rcar-dmac: Convert to platform remove callback returning void
  dma: sh: rz-dmac: Convert to platform remove callback returning void
  dma: sh: shdmac: Convert to platform remove callback returning void
  dma: sh: usb-dmac: Convert to platform remove callback returning void
  dma: sprd-dma: Convert to platform remove callback returning void
  dma: st_fdma: Convert to platform remove callback returning void
  dma: sun4i-dma: Convert to platform remove callback returning void
  dma: sun6i-dma: Convert to platform remove callback returning void
  dma: tegra186-gpc-dma: Convert to platform remove callback returning
    void
  dma: tegra20-apb-dma: Convert to platform remove callback returning
    void
  dma: tegra210-adma: Convert to platform remove callback returning void
  dma: ti: cppi41: Convert to platform remove callback returning void
  dma: ti: edma: Convert to platform remove callback returning void
  dma: ti: omap-dma: Convert to platform remove callback returning void
  dma: timb_dma: Convert to platform remove callback returning void
  dma: txx9dmac: Convert to platform remove callback returning void
  dma: xgene-dma: Convert to platform remove callback returning void
  dma: xilinx: xdma: Convert to platform remove callback returning void
  dma: xilinx: xilinx_dma: Convert to platform remove callback returning
    void
  dma: xilinx: xilinx_dpdma: Convert to platform remove callback
    returning void
  dma: xilinx: zynqmp_dma: Convert to platform remove callback returning
    void

 drivers/dma/altera-msgdma.c                    |  6 ++----
 drivers/dma/apple-admac.c                      |  6 ++----
 drivers/dma/at_hdmac.c                         |  6 ++----
 drivers/dma/at_xdmac.c                         |  6 ++----
 drivers/dma/bcm-sba-raid.c                     |  6 ++----
 drivers/dma/bcm2835-dma.c                      |  6 ++----
 drivers/dma/bestcomm/bestcomm.c                |  6 ++----
 drivers/dma/dma-axi-dmac.c                     |  6 ++----
 drivers/dma/dma-jz4780.c                       |  6 ++----
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c |  6 ++----
 drivers/dma/dw/platform.c                      |  6 ++----
 drivers/dma/fsl-edma-main.c                    |  6 ++----
 drivers/dma/fsl-qdma.c                         |  5 ++---
 drivers/dma/fsl_raid.c                         |  6 ++----
 drivers/dma/fsldma.c                           |  6 ++----
 drivers/dma/idma64.c                           |  6 ++----
 drivers/dma/img-mdc-dma.c                      |  6 ++----
 drivers/dma/imx-dma.c                          |  6 ++----
 drivers/dma/imx-sdma.c                         |  5 ++---
 drivers/dma/k3dma.c                            |  5 ++---
 drivers/dma/mcf-edma-main.c                    |  6 ++----
 drivers/dma/mediatek/mtk-cqdma.c               |  6 ++----
 drivers/dma/mediatek/mtk-hsdma.c               |  6 ++----
 drivers/dma/mediatek/mtk-uart-apdma.c          |  6 ++----
 drivers/dma/mmp_pdma.c                         |  5 ++---
 drivers/dma/mmp_tdma.c                         |  6 ++----
 drivers/dma/moxart-dma.c                       |  6 ++----
 drivers/dma/mpc512x_dma.c                      |  6 ++----
 drivers/dma/mv_xor_v2.c                        |  6 ++----
 drivers/dma/nbpfaxi.c                          |  6 ++----
 drivers/dma/owl-dma.c                          |  6 ++----
 drivers/dma/ppc4xx/adma.c                      |  5 ++---
 drivers/dma/pxa_dma.c                          |  5 ++---
 drivers/dma/qcom/bam_dma.c                     |  6 ++----
 drivers/dma/qcom/hidma.c                       |  6 ++----
 drivers/dma/qcom/qcom_adm.c                    |  6 ++----
 drivers/dma/sa11x0-dma.c                       |  6 ++----
 drivers/dma/sf-pdma/sf-pdma.c                  |  6 ++----
 drivers/dma/sh/rcar-dmac.c                     |  6 ++----
 drivers/dma/sh/rz-dmac.c                       |  6 ++----
 drivers/dma/sh/shdmac.c                        |  6 ++----
 drivers/dma/sh/usb-dmac.c                      |  6 ++----
 drivers/dma/sprd-dma.c                         |  5 ++---
 drivers/dma/st_fdma.c                          |  6 ++----
 drivers/dma/sun4i-dma.c                        |  6 ++----
 drivers/dma/sun6i-dma.c                        |  6 ++----
 drivers/dma/tegra186-gpc-dma.c                 |  6 ++----
 drivers/dma/tegra20-apb-dma.c                  |  6 ++----
 drivers/dma/tegra210-adma.c                    |  6 ++----
 drivers/dma/ti/cppi41.c                        |  5 ++---
 drivers/dma/ti/edma.c                          |  6 ++----
 drivers/dma/ti/omap-dma.c                      |  6 ++----
 drivers/dma/timb_dma.c                         |  5 ++---
 drivers/dma/txx9dmac.c                         | 10 ++++------
 drivers/dma/xgene-dma.c                        |  6 ++----
 drivers/dma/xilinx/xdma.c                      |  6 ++----
 drivers/dma/xilinx/xilinx_dma.c                |  6 ++----
 drivers/dma/xilinx/xilinx_dpdma.c              |  6 ++----
 drivers/dma/xilinx/zynqmp_dma.c                |  6 ++----
 59 files changed, 120 insertions(+), 229 deletions(-)


base-commit: 29e400e3ea486bf942b214769fc9778098114113
-- 
2.40.1


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

* [PATCH 01/59] dma: altera-msgdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-20 18:13   ` Olivier Dautricourt
  2023-09-19 13:31 ` [PATCH 02/59] dma: apple-admac: " Uwe Kleine-König
                   ` (59 subsequent siblings)
  60 siblings, 1 reply; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Olivier Dautricourt, Stefan Roese, 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/altera-msgdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/altera-msgdma.c b/drivers/dma/altera-msgdma.c
index 4153c2edb049..a8e3615235b8 100644
--- a/drivers/dma/altera-msgdma.c
+++ b/drivers/dma/altera-msgdma.c
@@ -923,7 +923,7 @@ static int msgdma_probe(struct platform_device *pdev)
  *
  * Return: Always '0'
  */
-static int msgdma_remove(struct platform_device *pdev)
+static void msgdma_remove(struct platform_device *pdev)
 {
 	struct msgdma_device *mdev = platform_get_drvdata(pdev);
 
@@ -933,8 +933,6 @@ static int msgdma_remove(struct platform_device *pdev)
 	msgdma_dev_remove(mdev);
 
 	dev_notice(&pdev->dev, "Altera mSGDMA driver removed\n");
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -952,7 +950,7 @@ static struct platform_driver msgdma_driver = {
 		.of_match_table = of_match_ptr(msgdma_match),
 	},
 	.probe = msgdma_probe,
-	.remove = msgdma_remove,
+	.remove_new = msgdma_remove,
 };
 
 module_platform_driver(msgdma_driver);
-- 
2.40.1


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

* [PATCH 02/59] dma: apple-admac: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 01/59] dma: altera-msgdma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 03/59] dma: at_hdmac: " Uwe Kleine-König
                   ` (58 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 03/59] dma: at_hdmac: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 01/59] dma: altera-msgdma: " Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 02/59] dma: apple-admac: " 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
                   ` (57 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 04/59] dma: at_xdmac: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  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 05/59] dma: bcm-sba-raid: " Uwe Kleine-König
                   ` (56 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 05/59] dma: bcm-sba-raid: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 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 06/59] dma: bcm2835-dma: " Uwe Kleine-König
                   ` (55 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/bcm-sba-raid.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/bcm-sba-raid.c b/drivers/dma/bcm-sba-raid.c
index 94ea35330eb5..fbaacb4c19b2 100644
--- a/drivers/dma/bcm-sba-raid.c
+++ b/drivers/dma/bcm-sba-raid.c
@@ -1734,7 +1734,7 @@ static int sba_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sba_remove(struct platform_device *pdev)
+static void sba_remove(struct platform_device *pdev)
 {
 	struct sba_device *sba = platform_get_drvdata(pdev);
 
@@ -1745,8 +1745,6 @@ static int sba_remove(struct platform_device *pdev)
 	sba_freeup_channel_resources(sba);
 
 	mbox_free_channel(sba->mchan);
-
-	return 0;
 }
 
 static const struct of_device_id sba_of_match[] = {
@@ -1758,7 +1756,7 @@ MODULE_DEVICE_TABLE(of, sba_of_match);
 
 static struct platform_driver sba_driver = {
 	.probe = sba_probe,
-	.remove = sba_remove,
+	.remove_new = sba_remove,
 	.driver = {
 		.name = "bcm-sba-raid",
 		.of_match_table = sba_of_match,
-- 
2.40.1


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

* [PATCH 06/59] dma: bcm2835-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 05/59] dma: bcm-sba-raid: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 07/59] dma: bestcomm: bestcomm: " Uwe Kleine-König
                   ` (54 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 07/59] dma: bestcomm: bestcomm: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (5 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 08/59] dma: dma-axi-dmac: " Uwe Kleine-König
                   ` (53 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Rob Herring, 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/bestcomm/bestcomm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/bestcomm/bestcomm.c b/drivers/dma/bestcomm/bestcomm.c
index 80096f94032d..0bbaa7620bdd 100644
--- a/drivers/dma/bestcomm/bestcomm.c
+++ b/drivers/dma/bestcomm/bestcomm.c
@@ -455,7 +455,7 @@ static int mpc52xx_bcom_probe(struct platform_device *op)
 }
 
 
-static int mpc52xx_bcom_remove(struct platform_device *op)
+static void mpc52xx_bcom_remove(struct platform_device *op)
 {
 	/* Clean up the engine */
 	bcom_engine_cleanup();
@@ -473,8 +473,6 @@ static int mpc52xx_bcom_remove(struct platform_device *op)
 	/* Release memory */
 	kfree(bcom_eng);
 	bcom_eng = NULL;
-
-	return 0;
 }
 
 static const struct of_device_id mpc52xx_bcom_of_match[] = {
@@ -488,7 +486,7 @@ MODULE_DEVICE_TABLE(of, mpc52xx_bcom_of_match);
 
 static struct platform_driver mpc52xx_bcom_of_platform_driver = {
 	.probe		= mpc52xx_bcom_probe,
-	.remove		= mpc52xx_bcom_remove,
+	.remove_new	= mpc52xx_bcom_remove,
 	.driver = {
 		.name = DRIVER_NAME,
 		.of_match_table = mpc52xx_bcom_of_match,
-- 
2.40.1


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

* [PATCH 08/59] dma: dma-axi-dmac: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (6 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 07/59] dma: bestcomm: bestcomm: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 09/59] dma: dma-jz4780: " Uwe Kleine-König
                   ` (52 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Lars-Peter Clausen, 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/dma-axi-dmac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index fc7cdad37161..a6d235bc8444 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -1029,7 +1029,7 @@ static int axi_dmac_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int axi_dmac_remove(struct platform_device *pdev)
+static void axi_dmac_remove(struct platform_device *pdev)
 {
 	struct axi_dmac *dmac = platform_get_drvdata(pdev);
 
@@ -1038,8 +1038,6 @@ static int axi_dmac_remove(struct platform_device *pdev)
 	tasklet_kill(&dmac->chan.vchan.task);
 	dma_async_device_unregister(&dmac->dma_dev);
 	clk_disable_unprepare(dmac->clk);
-
-	return 0;
 }
 
 static const struct of_device_id axi_dmac_of_match_table[] = {
@@ -1054,7 +1052,7 @@ static struct platform_driver axi_dmac_driver = {
 		.of_match_table = axi_dmac_of_match_table,
 	},
 	.probe = axi_dmac_probe,
-	.remove = axi_dmac_remove,
+	.remove_new = axi_dmac_remove,
 };
 module_platform_driver(axi_dmac_driver);
 
-- 
2.40.1


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

* [PATCH 09/59] dma: dma-jz4780: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (7 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 08/59] dma: dma-axi-dmac: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:39   ` Paul Cercueil
  2023-09-20 15:44   ` Philippe Mathieu-Daudé
  2023-09-19 13:31 ` [PATCH 10/59] dma: dw-axi-dmac: dw-axi-dmac-platform: " Uwe Kleine-König
                   ` (51 subsequent siblings)
  60 siblings, 2 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Paul Cercueil, linux-mips, 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/dma-jz4780.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index adbd47bd6adf..c9cfa341db51 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -1008,7 +1008,7 @@ static int jz4780_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int jz4780_dma_remove(struct platform_device *pdev)
+static void jz4780_dma_remove(struct platform_device *pdev)
 {
 	struct jz4780_dma_dev *jzdma = platform_get_drvdata(pdev);
 	int i;
@@ -1020,8 +1020,6 @@ static int jz4780_dma_remove(struct platform_device *pdev)
 
 	for (i = 0; i < jzdma->soc_data->nb_channels; i++)
 		tasklet_kill(&jzdma->chan[i].vchan.task);
-
-	return 0;
 }
 
 static const struct jz4780_dma_soc_data jz4740_dma_soc_data = {
@@ -1124,7 +1122,7 @@ MODULE_DEVICE_TABLE(of, jz4780_dma_dt_match);
 
 static struct platform_driver jz4780_dma_driver = {
 	.probe		= jz4780_dma_probe,
-	.remove		= jz4780_dma_remove,
+	.remove_new	= jz4780_dma_remove,
 	.driver	= {
 		.name	= "jz4780-dma",
 		.of_match_table = jz4780_dma_dt_match,
-- 
2.40.1


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

* [PATCH 10/59] dma: dw-axi-dmac: dw-axi-dmac-platform: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (8 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 09/59] dma: dma-jz4780: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 11/59] dma: dw: platform: " Uwe Kleine-König
                   ` (50 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Eugeniy Paltsev, 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/dw-axi-dmac/dw-axi-dmac-platform.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index dd02f84e404d..974da2fda2e4 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1535,7 +1535,7 @@ static int dw_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int dw_remove(struct platform_device *pdev)
+static void dw_remove(struct platform_device *pdev)
 {
 	struct axi_dma_chip *chip = platform_get_drvdata(pdev);
 	struct dw_axi_dma *dw = chip->dw;
@@ -1564,8 +1564,6 @@ static int dw_remove(struct platform_device *pdev)
 		list_del(&chan->vc.chan.device_node);
 		tasklet_kill(&chan->vc.task);
 	}
-
-	return 0;
 }
 
 static const struct dev_pm_ops dw_axi_dma_pm_ops = {
@@ -1588,7 +1586,7 @@ MODULE_DEVICE_TABLE(of, dw_dma_of_id_table);
 
 static struct platform_driver dw_driver = {
 	.probe		= dw_probe,
-	.remove		= dw_remove,
+	.remove_new	= dw_remove,
 	.driver = {
 		.name	= KBUILD_MODNAME,
 		.of_match_table = dw_dma_of_id_table,
-- 
2.40.1


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

* [PATCH 11/59] dma: dw: platform: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (9 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 10/59] dma: dw-axi-dmac: dw-axi-dmac-platform: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-28  7:09   ` Viresh Kumar
  2023-09-19 13:31 ` [PATCH 12/59] dma: fsl-edma-main: " Uwe Kleine-König
                   ` (49 subsequent siblings)
  60 siblings, 1 reply; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Viresh Kumar, Andy Shevchenko, 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/dw/platform.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index 47f2292dba98..7d9d4c951724 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -93,7 +93,7 @@ static int dw_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int dw_remove(struct platform_device *pdev)
+static void dw_remove(struct platform_device *pdev)
 {
 	struct dw_dma_chip_pdata *data = platform_get_drvdata(pdev);
 	struct dw_dma_chip *chip = data->chip;
@@ -109,8 +109,6 @@ static int dw_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(&pdev->dev);
 	clk_disable_unprepare(chip->clk);
-
-	return 0;
 }
 
 static void dw_shutdown(struct platform_device *pdev)
@@ -193,7 +191,7 @@ static const struct dev_pm_ops dw_dev_pm_ops = {
 
 static struct platform_driver dw_driver = {
 	.probe		= dw_probe,
-	.remove		= dw_remove,
+	.remove_new	= dw_remove,
 	.shutdown       = dw_shutdown,
 	.driver = {
 		.name	= DRV_NAME,
-- 
2.40.1


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

* [PATCH 12/59] dma: fsl-edma-main: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (10 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 11/59] dma: dw: platform: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 13/59] dma: fsl-qdma: " Uwe Kleine-König
                   ` (48 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/fsl-edma-main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
index 63d48d046f04..11da143955b3 100644
--- a/drivers/dma/fsl-edma-main.c
+++ b/drivers/dma/fsl-edma-main.c
@@ -615,7 +615,7 @@ static int fsl_edma_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int fsl_edma_remove(struct platform_device *pdev)
+static void fsl_edma_remove(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct fsl_edma_engine *fsl_edma = platform_get_drvdata(pdev);
@@ -625,8 +625,6 @@ static int fsl_edma_remove(struct platform_device *pdev)
 	of_dma_controller_free(np);
 	dma_async_device_unregister(&fsl_edma->dma_dev);
 	fsl_disable_clocks(fsl_edma, fsl_edma->drvdata->dmamuxs);
-
-	return 0;
 }
 
 static int fsl_edma_suspend_late(struct device *dev)
@@ -690,7 +688,7 @@ static struct platform_driver fsl_edma_driver = {
 		.pm     = &fsl_edma_pm_ops,
 	},
 	.probe          = fsl_edma_probe,
-	.remove		= fsl_edma_remove,
+	.remove_new	= fsl_edma_remove,
 };
 
 static int __init fsl_edma_init(void)
-- 
2.40.1


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

* [PATCH 13/59] dma: fsl-qdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (11 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 12/59] dma: fsl-edma-main: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 14/59] dma: fsl_raid: " Uwe Kleine-König
                   ` (47 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/fsl-qdma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
index a8cc8a4bc610..47cb28468049 100644
--- a/drivers/dma/fsl-qdma.c
+++ b/drivers/dma/fsl-qdma.c
@@ -1266,7 +1266,7 @@ static void fsl_qdma_cleanup_vchan(struct dma_device *dmadev)
 	}
 }
 
-static int fsl_qdma_remove(struct platform_device *pdev)
+static void fsl_qdma_remove(struct platform_device *pdev)
 {
 	int i;
 	struct fsl_qdma_queue *status;
@@ -1283,7 +1283,6 @@ static int fsl_qdma_remove(struct platform_device *pdev)
 		dma_free_coherent(&pdev->dev, sizeof(struct fsl_qdma_format) *
 				status->n_cq, status->cq, status->bus_addr);
 	}
-	return 0;
 }
 
 static const struct of_device_id fsl_qdma_dt_ids[] = {
@@ -1298,7 +1297,7 @@ static struct platform_driver fsl_qdma_driver = {
 		.of_match_table = fsl_qdma_dt_ids,
 	},
 	.probe          = fsl_qdma_probe,
-	.remove		= fsl_qdma_remove,
+	.remove_new	= fsl_qdma_remove,
 };
 
 module_platform_driver(fsl_qdma_driver);
-- 
2.40.1


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

* [PATCH 14/59] dma: fsl_raid: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (12 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 13/59] dma: fsl-qdma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 15/59] dma: fsldma: " Uwe Kleine-König
                   ` (46 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/fsl_raid.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c
index 0b9ca93ce3dc..014ff523d5ec 100644
--- a/drivers/dma/fsl_raid.c
+++ b/drivers/dma/fsl_raid.c
@@ -857,7 +857,7 @@ static void fsl_re_remove_chan(struct fsl_re_chan *chan)
 		      chan->oub_phys_addr);
 }
 
-static int fsl_re_remove(struct platform_device *ofdev)
+static void fsl_re_remove(struct platform_device *ofdev)
 {
 	struct fsl_re_drv_private *re_priv;
 	struct device *dev;
@@ -872,8 +872,6 @@ static int fsl_re_remove(struct platform_device *ofdev)
 
 	/* Unregister the driver */
 	dma_async_device_unregister(&re_priv->dma_dev);
-
-	return 0;
 }
 
 static const struct of_device_id fsl_re_ids[] = {
@@ -888,7 +886,7 @@ static struct platform_driver fsl_re_driver = {
 		.of_match_table = fsl_re_ids,
 	},
 	.probe = fsl_re_probe,
-	.remove = fsl_re_remove,
+	.remove_new = fsl_re_remove,
 };
 
 module_platform_driver(fsl_re_driver);
-- 
2.40.1


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

* [PATCH 15/59] dma: fsldma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (13 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 14/59] dma: fsl_raid: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 16/59] dma: idma64: " Uwe Kleine-König
                   ` (45 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Li Yang, Zhang Wei, linuxppc-dev, 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/fsldma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index ddcf736d283d..18a6c4bf6275 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1306,7 +1306,7 @@ static int fsldma_of_probe(struct platform_device *op)
 	return err;
 }
 
-static int fsldma_of_remove(struct platform_device *op)
+static void fsldma_of_remove(struct platform_device *op)
 {
 	struct fsldma_device *fdev;
 	unsigned int i;
@@ -1324,8 +1324,6 @@ static int fsldma_of_remove(struct platform_device *op)
 
 	iounmap(fdev->regs);
 	kfree(fdev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -1406,7 +1404,7 @@ static struct platform_driver fsldma_of_driver = {
 #endif
 	},
 	.probe = fsldma_of_probe,
-	.remove = fsldma_of_remove,
+	.remove_new = fsldma_of_remove,
 };
 
 /*----------------------------------------------------------------------------*/
-- 
2.40.1


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

* [PATCH 16/59] dma: idma64: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (14 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 15/59] dma: fsldma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 17/59] dma: img-mdc-dma: " Uwe Kleine-König
                   ` (44 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/idma64.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c
index 0ac634a51c5e..78a938969d7d 100644
--- a/drivers/dma/idma64.c
+++ b/drivers/dma/idma64.c
@@ -660,13 +660,11 @@ static int idma64_platform_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int idma64_platform_remove(struct platform_device *pdev)
+static void idma64_platform_remove(struct platform_device *pdev)
 {
 	struct idma64_chip *chip = platform_get_drvdata(pdev);
 
 	idma64_remove(chip);
-
-	return 0;
 }
 
 static int __maybe_unused idma64_pm_suspend(struct device *dev)
@@ -691,7 +689,7 @@ static const struct dev_pm_ops idma64_dev_pm_ops = {
 
 static struct platform_driver idma64_platform_driver = {
 	.probe		= idma64_platform_probe,
-	.remove		= idma64_platform_remove,
+	.remove_new	= idma64_platform_remove,
 	.driver = {
 		.name	= LPSS_IDMA64_DRIVER_NAME,
 		.pm	= &idma64_dev_pm_ops,
-- 
2.40.1


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

* [PATCH 17/59] dma: img-mdc-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (15 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 16/59] dma: idma64: " 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
                   ` (43 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/img-mdc-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/img-mdc-dma.c b/drivers/dma/img-mdc-dma.c
index 9be0d3226e19..0532dd2640dc 100644
--- a/drivers/dma/img-mdc-dma.c
+++ b/drivers/dma/img-mdc-dma.c
@@ -1017,7 +1017,7 @@ static int mdc_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mdc_dma_remove(struct platform_device *pdev)
+static void mdc_dma_remove(struct platform_device *pdev)
 {
 	struct mdc_dma *mdma = platform_get_drvdata(pdev);
 	struct mdc_chan *mchan, *next;
@@ -1037,8 +1037,6 @@ static int mdc_dma_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 	if (!pm_runtime_status_suspended(&pdev->dev))
 		img_mdc_runtime_suspend(&pdev->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -1078,7 +1076,7 @@ static struct platform_driver mdc_dma_driver = {
 		.of_match_table = of_match_ptr(mdc_dma_of_match),
 	},
 	.probe = mdc_dma_probe,
-	.remove = mdc_dma_remove,
+	.remove_new = mdc_dma_remove,
 };
 module_platform_driver(mdc_dma_driver);
 
-- 
2.40.1


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

* [PATCH 18/59] dma: imx-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (16 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 17/59] dma: img-mdc-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
                   ` (42 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 19/59] dma: imx-sdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (17 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 20/59] dma: k3dma: " Uwe Kleine-König
                   ` (41 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 20/59] dma: k3dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (18 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-19 13:31 ` [PATCH 21/59] dma: mcf-edma-main: " Uwe Kleine-König
                   ` (40 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/k3dma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index ecdaada95120..22b37b525a48 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -974,7 +974,7 @@ static int k3_dma_probe(struct platform_device *op)
 	return ret;
 }
 
-static int k3_dma_remove(struct platform_device *op)
+static void k3_dma_remove(struct platform_device *op)
 {
 	struct k3_dma_chan *c, *cn;
 	struct k3_dma_dev *d = platform_get_drvdata(op);
@@ -990,7 +990,6 @@ static int k3_dma_remove(struct platform_device *op)
 	}
 	tasklet_kill(&d->task);
 	clk_disable_unprepare(d->clk);
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -1034,7 +1033,7 @@ static struct platform_driver k3_pdma_driver = {
 		.of_match_table = k3_pdma_dt_ids,
 	},
 	.probe		= k3_dma_probe,
-	.remove		= k3_dma_remove,
+	.remove_new	= k3_dma_remove,
 };
 
 module_platform_driver(k3_pdma_driver);
-- 
2.40.1


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

* [PATCH 21/59] dma: mcf-edma-main: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (19 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 20/59] dma: k3dma: " 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
                   ` (39 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/mcf-edma-main.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c
index b359421ee9ea..ab21455d9c3a 100644
--- a/drivers/dma/mcf-edma-main.c
+++ b/drivers/dma/mcf-edma-main.c
@@ -255,15 +255,13 @@ static int mcf_edma_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int mcf_edma_remove(struct platform_device *pdev)
+static void mcf_edma_remove(struct platform_device *pdev)
 {
 	struct fsl_edma_engine *mcf_edma = platform_get_drvdata(pdev);
 
 	mcf_edma_irq_free(pdev, mcf_edma);
 	fsl_edma_cleanup_vchan(&mcf_edma->dma_dev);
 	dma_async_device_unregister(&mcf_edma->dma_dev);
-
-	return 0;
 }
 
 static struct platform_driver mcf_edma_driver = {
@@ -271,7 +269,7 @@ static struct platform_driver mcf_edma_driver = {
 		.name	= "mcf-edma",
 	},
 	.probe		= mcf_edma_probe,
-	.remove		= mcf_edma_remove,
+	.remove_new	= mcf_edma_remove,
 };
 
 bool mcf_edma_filter_fn(struct dma_chan *chan, void *param)
-- 
2.40.1


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

* [PATCH 22/59] dma: mediatek: mtk-cqdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (20 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 21/59] dma: mcf-edma-main: " 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
                   ` (38 subsequent siblings)
  60 siblings, 1 reply; 82+ 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


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

* [PATCH 23/59] dma: mediatek: mtk-hsdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (21 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
                   ` (37 subsequent siblings)
  60 siblings, 1 reply; 82+ 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


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

* [PATCH 24/59] dma: mediatek: mtk-uart-apdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (22 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 25/59] dma: mmp_pdma: " Uwe Kleine-König
                   ` (36 subsequent siblings)
  60 siblings, 1 reply; 82+ 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


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

* [PATCH 25/59] dma: mmp_pdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (23 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 26/59] dma: mmp_tdma: " Uwe Kleine-König
                   ` (35 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/mmp_pdma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index ebdfdcbb4f7a..492ec491a59b 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -932,7 +932,7 @@ static void dma_do_tasklet(struct tasklet_struct *t)
 	}
 }
 
-static int mmp_pdma_remove(struct platform_device *op)
+static void mmp_pdma_remove(struct platform_device *op)
 {
 	struct mmp_pdma_device *pdev = platform_get_drvdata(op);
 	struct mmp_pdma_phy *phy;
@@ -958,7 +958,6 @@ static int mmp_pdma_remove(struct platform_device *op)
 	}
 
 	dma_async_device_unregister(&pdev->device);
-	return 0;
 }
 
 static int mmp_pdma_chan_init(struct mmp_pdma_device *pdev, int idx, int irq)
@@ -1141,7 +1140,7 @@ static struct platform_driver mmp_pdma_driver = {
 	},
 	.id_table	= mmp_pdma_id_table,
 	.probe		= mmp_pdma_probe,
-	.remove		= mmp_pdma_remove,
+	.remove_new	= mmp_pdma_remove,
 };
 
 module_platform_driver(mmp_pdma_driver);
-- 
2.40.1


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

* [PATCH 26/59] dma: mmp_tdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (24 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 25/59] dma: mmp_pdma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 27/59] dma: moxart-dma: " Uwe Kleine-König
                   ` (34 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/mmp_tdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index d49fa6bc6775..f039e07181f7 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -552,12 +552,10 @@ static void mmp_tdma_issue_pending(struct dma_chan *chan)
 	mmp_tdma_enable_chan(tdmac);
 }
 
-static int mmp_tdma_remove(struct platform_device *pdev)
+static void mmp_tdma_remove(struct platform_device *pdev)
 {
 	if (pdev->dev.of_node)
 		of_dma_controller_free(pdev->dev.of_node);
-
-	return 0;
 }
 
 static int mmp_tdma_chan_init(struct mmp_tdma_device *tdev,
@@ -753,7 +751,7 @@ static struct platform_driver mmp_tdma_driver = {
 	},
 	.id_table	= mmp_tdma_id_table,
 	.probe		= mmp_tdma_probe,
-	.remove		= mmp_tdma_remove,
+	.remove_new	= mmp_tdma_remove,
 };
 
 module_platform_driver(mmp_tdma_driver);
-- 
2.40.1


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

* [PATCH 27/59] dma: moxart-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (25 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 26/59] dma: mmp_tdma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 28/59] dma: mpc512x_dma: " Uwe Kleine-König
                   ` (33 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/moxart-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c
index 7565ad98ba66..a03953b3016b 100644
--- a/drivers/dma/moxart-dma.c
+++ b/drivers/dma/moxart-dma.c
@@ -630,7 +630,7 @@ static int moxart_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int moxart_remove(struct platform_device *pdev)
+static void moxart_remove(struct platform_device *pdev)
 {
 	struct moxart_dmadev *m = platform_get_drvdata(pdev);
 
@@ -640,8 +640,6 @@ static int moxart_remove(struct platform_device *pdev)
 
 	if (pdev->dev.of_node)
 		of_dma_controller_free(pdev->dev.of_node);
-
-	return 0;
 }
 
 static const struct of_device_id moxart_dma_match[] = {
@@ -652,7 +650,7 @@ MODULE_DEVICE_TABLE(of, moxart_dma_match);
 
 static struct platform_driver moxart_driver = {
 	.probe	= moxart_probe,
-	.remove	= moxart_remove,
+	.remove_new = moxart_remove,
 	.driver = {
 		.name		= "moxart-dma-engine",
 		.of_match_table	= moxart_dma_match,
-- 
2.40.1


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

* [PATCH 28/59] dma: mpc512x_dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (26 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 27/59] dma: moxart-dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 29/59] dma: mv_xor_v2: " Uwe Kleine-König
                   ` (32 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/mpc512x_dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c
index 1104017320b8..68c247a46321 100644
--- a/drivers/dma/mpc512x_dma.c
+++ b/drivers/dma/mpc512x_dma.c
@@ -1084,7 +1084,7 @@ static int mpc_dma_probe(struct platform_device *op)
 	return retval;
 }
 
-static int mpc_dma_remove(struct platform_device *op)
+static void mpc_dma_remove(struct platform_device *op)
 {
 	struct device *dev = &op->dev;
 	struct mpc_dma *mdma = dev_get_drvdata(dev);
@@ -1099,8 +1099,6 @@ static int mpc_dma_remove(struct platform_device *op)
 	free_irq(mdma->irq, mdma);
 	irq_dispose_mapping(mdma->irq);
 	tasklet_kill(&mdma->tasklet);
-
-	return 0;
 }
 
 static const struct of_device_id mpc_dma_match[] = {
@@ -1112,7 +1110,7 @@ MODULE_DEVICE_TABLE(of, mpc_dma_match);
 
 static struct platform_driver mpc_dma_driver = {
 	.probe		= mpc_dma_probe,
-	.remove		= mpc_dma_remove,
+	.remove_new	= mpc_dma_remove,
 	.driver = {
 		.name = DRV_NAME,
 		.of_match_table	= mpc_dma_match,
-- 
2.40.1


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

* [PATCH 29/59] dma: mv_xor_v2: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (27 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 28/59] dma: mpc512x_dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 30/59] dma: nbpfaxi: " Uwe Kleine-König
                   ` (31 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/mv_xor_v2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c
index 0e1e9ca1c005..1ebfbe88e733 100644
--- a/drivers/dma/mv_xor_v2.c
+++ b/drivers/dma/mv_xor_v2.c
@@ -855,7 +855,7 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mv_xor_v2_remove(struct platform_device *pdev)
+static void mv_xor_v2_remove(struct platform_device *pdev)
 {
 	struct mv_xor_v2_device *xor_dev = platform_get_drvdata(pdev);
 
@@ -870,8 +870,6 @@ static int mv_xor_v2_remove(struct platform_device *pdev)
 	platform_msi_domain_free_irqs(&pdev->dev);
 
 	tasklet_kill(&xor_dev->irq_tasklet);
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -886,7 +884,7 @@ static struct platform_driver mv_xor_v2_driver = {
 	.probe		= mv_xor_v2_probe,
 	.suspend	= mv_xor_v2_suspend,
 	.resume		= mv_xor_v2_resume,
-	.remove		= mv_xor_v2_remove,
+	.remove_new	= mv_xor_v2_remove,
 	.driver		= {
 		.name	= "mv_xor_v2",
 		.of_match_table = of_match_ptr(mv_xor_v2_dt_ids),
-- 
2.40.1


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

* [PATCH 30/59] dma: nbpfaxi: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (28 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 29/59] dma: mv_xor_v2: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 31/59] dma: owl-dma: " Uwe Kleine-König
                   ` (30 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/nbpfaxi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c
index 0b2f96fd8bf0..c08916339aa7 100644
--- a/drivers/dma/nbpfaxi.c
+++ b/drivers/dma/nbpfaxi.c
@@ -1454,7 +1454,7 @@ static int nbpf_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int nbpf_remove(struct platform_device *pdev)
+static void nbpf_remove(struct platform_device *pdev)
 {
 	struct nbpf_device *nbpf = platform_get_drvdata(pdev);
 	int i;
@@ -1472,8 +1472,6 @@ static int nbpf_remove(struct platform_device *pdev)
 	of_dma_controller_free(pdev->dev.of_node);
 	dma_async_device_unregister(&nbpf->dma_dev);
 	clk_disable_unprepare(nbpf->clk);
-
-	return 0;
 }
 
 static const struct platform_device_id nbpf_ids[] = {
@@ -1517,7 +1515,7 @@ static struct platform_driver nbpf_driver = {
 	},
 	.id_table = nbpf_ids,
 	.probe = nbpf_probe,
-	.remove = nbpf_remove,
+	.remove_new = nbpf_remove,
 };
 
 module_platform_driver(nbpf_driver);
-- 
2.40.1


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

* [PATCH 31/59] dma: owl-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (29 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 30/59] dma: nbpfaxi: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 32/59] dma: ppc4xx: adma: " Uwe Kleine-König
                   ` (29 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 32/59] dma: ppc4xx: adma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (30 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 33/59] dma: pxa_dma: " Uwe Kleine-König
                   ` (28 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: ye xingchen, Rob Herring, 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/ppc4xx/adma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index f9b82dff3387..bbb60a970dab 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -4230,7 +4230,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev)
 /**
  * ppc440spe_adma_remove - remove the asynch device
  */
-static int ppc440spe_adma_remove(struct platform_device *ofdev)
+static void ppc440spe_adma_remove(struct platform_device *ofdev)
 {
 	struct ppc440spe_adma_device *adev = platform_get_drvdata(ofdev);
 	struct device_node *np = ofdev->dev.of_node;
@@ -4278,7 +4278,6 @@ static int ppc440spe_adma_remove(struct platform_device *ofdev)
 	of_address_to_resource(np, 0, &res);
 	release_mem_region(res.start, resource_size(&res));
 	kfree(adev);
-	return 0;
 }
 
 /*
@@ -4550,7 +4549,7 @@ MODULE_DEVICE_TABLE(of, ppc440spe_adma_of_match);
 
 static struct platform_driver ppc440spe_adma_driver = {
 	.probe = ppc440spe_adma_probe,
-	.remove = ppc440spe_adma_remove,
+	.remove_new = ppc440spe_adma_remove,
 	.driver = {
 		.name = "PPC440SP(E)-ADMA",
 		.of_match_table = ppc440spe_adma_of_match,
-- 
2.40.1


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

* [PATCH 33/59] dma: pxa_dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (31 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 32/59] dma: ppc4xx: adma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 34/59] dma: qcom: bam_dma: " Uwe Kleine-König
                   ` (27 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 34/59] dma: qcom: bam_dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (32 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 35/59] dma: qcom: hidma: " Uwe Kleine-König
                   ` (26 subsequent siblings)
  60 siblings, 1 reply; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, 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/bam_dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 4c3eb972039d..c4f8d17d0c68 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -1386,7 +1386,7 @@ static int bam_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int bam_dma_remove(struct platform_device *pdev)
+static void bam_dma_remove(struct platform_device *pdev)
 {
 	struct bam_device *bdev = platform_get_drvdata(pdev);
 	u32 i;
@@ -1416,8 +1416,6 @@ static int bam_dma_remove(struct platform_device *pdev)
 	tasklet_kill(&bdev->task);
 
 	clk_disable_unprepare(bdev->bamclk);
-
-	return 0;
 }
 
 static int __maybe_unused bam_dma_runtime_suspend(struct device *dev)
@@ -1475,7 +1473,7 @@ static const struct dev_pm_ops bam_dma_pm_ops = {
 
 static struct platform_driver bam_dma_driver = {
 	.probe = bam_dma_probe,
-	.remove = bam_dma_remove,
+	.remove_new = bam_dma_remove,
 	.driver = {
 		.name = "bam-dma-engine",
 		.pm = &bam_dma_pm_ops,
-- 
2.40.1


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

* [PATCH 35/59] dma: qcom: hidma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (33 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 34/59] dma: qcom: bam_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 36/59] dma: qcom: qcom_adm: " Uwe Kleine-König
                   ` (25 subsequent siblings)
  60 siblings, 1 reply; 82+ 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


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

* [PATCH 36/59] dma: qcom: qcom_adm: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (34 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 21:02   ` Konrad Dybcio
  2023-09-19 13:31 ` [PATCH 37/59] dma: sa11x0-dma: " Uwe Kleine-König
                   ` (24 subsequent siblings)
  60 siblings, 1 reply; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, 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/qcom_adm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/qcom/qcom_adm.c b/drivers/dma/qcom/qcom_adm.c
index d56caf1681ff..53f4273b657c 100644
--- a/drivers/dma/qcom/qcom_adm.c
+++ b/drivers/dma/qcom/qcom_adm.c
@@ -904,7 +904,7 @@ static int adm_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int adm_dma_remove(struct platform_device *pdev)
+static void adm_dma_remove(struct platform_device *pdev)
 {
 	struct adm_device *adev = platform_get_drvdata(pdev);
 	struct adm_chan *achan;
@@ -927,8 +927,6 @@ static int adm_dma_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(adev->core_clk);
 	clk_disable_unprepare(adev->iface_clk);
-
-	return 0;
 }
 
 static const struct of_device_id adm_of_match[] = {
@@ -939,7 +937,7 @@ MODULE_DEVICE_TABLE(of, adm_of_match);
 
 static struct platform_driver adm_dma_driver = {
 	.probe = adm_dma_probe,
-	.remove = adm_dma_remove,
+	.remove_new = adm_dma_remove,
 	.driver = {
 		.name = "adm-dma-engine",
 		.of_match_table = adm_of_match,
-- 
2.40.1


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

* [PATCH 37/59] dma: sa11x0-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (35 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 36/59] dma: qcom: qcom_adm: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 38/59] dma: sf-pdma: sf-pdma: " Uwe Kleine-König
                   ` (23 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/sa11x0-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c
index a29c13cae716..488408e6826a 100644
--- a/drivers/dma/sa11x0-dma.c
+++ b/drivers/dma/sa11x0-dma.c
@@ -984,7 +984,7 @@ static int sa11x0_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sa11x0_dma_remove(struct platform_device *pdev)
+static void sa11x0_dma_remove(struct platform_device *pdev)
 {
 	struct sa11x0_dma_dev *d = platform_get_drvdata(pdev);
 	unsigned pch;
@@ -997,8 +997,6 @@ static int sa11x0_dma_remove(struct platform_device *pdev)
 	tasklet_kill(&d->task);
 	iounmap(d->base);
 	kfree(d);
-
-	return 0;
 }
 
 static __maybe_unused int sa11x0_dma_suspend(struct device *dev)
@@ -1081,7 +1079,7 @@ static struct platform_driver sa11x0_dma_driver = {
 		.pm	= &sa11x0_dma_pm_ops,
 	},
 	.probe		= sa11x0_dma_probe,
-	.remove		= sa11x0_dma_remove,
+	.remove_new	= sa11x0_dma_remove,
 };
 
 static int __init sa11x0_dma_init(void)
-- 
2.40.1


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

* [PATCH 38/59] dma: sf-pdma: sf-pdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (36 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 37/59] dma: sa11x0-dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 39/59] dma: sh: rcar-dmac: " Uwe Kleine-König
                   ` (22 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Green Wan, 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/sf-pdma/sf-pdma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sf-pdma/sf-pdma.c b/drivers/dma/sf-pdma/sf-pdma.c
index d1c6956af452..3125a2f162b4 100644
--- a/drivers/dma/sf-pdma/sf-pdma.c
+++ b/drivers/dma/sf-pdma/sf-pdma.c
@@ -566,7 +566,7 @@ static int sf_pdma_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int sf_pdma_remove(struct platform_device *pdev)
+static void sf_pdma_remove(struct platform_device *pdev)
 {
 	struct sf_pdma *pdma = platform_get_drvdata(pdev);
 	struct sf_pdma_chan *ch;
@@ -584,8 +584,6 @@ static int sf_pdma_remove(struct platform_device *pdev)
 	}
 
 	dma_async_device_unregister(&pdma->dma_dev);
-
-	return 0;
 }
 
 static const struct of_device_id sf_pdma_dt_ids[] = {
@@ -597,7 +595,7 @@ MODULE_DEVICE_TABLE(of, sf_pdma_dt_ids);
 
 static struct platform_driver sf_pdma_driver = {
 	.probe		= sf_pdma_probe,
-	.remove		= sf_pdma_remove,
+	.remove_new	= sf_pdma_remove,
 	.driver		= {
 		.name	= "sf-pdma",
 		.of_match_table = sf_pdma_dt_ids,
-- 
2.40.1


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

* [PATCH 39/59] dma: sh: rcar-dmac: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (37 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 38/59] dma: sf-pdma: sf-pdma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 40/59] dma: sh: rz-dmac: " Uwe Kleine-König
                   ` (21 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Kees Cook, Gustavo A. R. Silva, 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/sh/rcar-dmac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 641d689d17ff..40482cb73d79 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1990,7 +1990,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int rcar_dmac_remove(struct platform_device *pdev)
+static void rcar_dmac_remove(struct platform_device *pdev)
 {
 	struct rcar_dmac *dmac = platform_get_drvdata(pdev);
 
@@ -1998,8 +1998,6 @@ static int rcar_dmac_remove(struct platform_device *pdev)
 	dma_async_device_unregister(&dmac->engine);
 
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static void rcar_dmac_shutdown(struct platform_device *pdev)
@@ -2041,7 +2039,7 @@ static struct platform_driver rcar_dmac_driver = {
 		.of_match_table = rcar_dmac_of_ids,
 	},
 	.probe		= rcar_dmac_probe,
-	.remove		= rcar_dmac_remove,
+	.remove_new	= rcar_dmac_remove,
 	.shutdown	= rcar_dmac_shutdown,
 };
 
-- 
2.40.1


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

* [PATCH 40/59] dma: sh: rz-dmac: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (38 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 39/59] dma: sh: rcar-dmac: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:35   ` Geert Uytterhoeven
  2023-09-19 13:31 ` [PATCH 41/59] dma: sh: shdmac: " Uwe Kleine-König
                   ` (20 subsequent siblings)
  60 siblings, 1 reply; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Biju Das, Geert Uytterhoeven, Lad Prabhakar, Pavel Machek,
	Hien Huynh, 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/sh/rz-dmac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c
index f777addda8ba..fea5bda34bc2 100644
--- a/drivers/dma/sh/rz-dmac.c
+++ b/drivers/dma/sh/rz-dmac.c
@@ -969,7 +969,7 @@ static int rz_dmac_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int rz_dmac_remove(struct platform_device *pdev)
+static void rz_dmac_remove(struct platform_device *pdev)
 {
 	struct rz_dmac *dmac = platform_get_drvdata(pdev);
 	unsigned int i;
@@ -987,8 +987,6 @@ static int rz_dmac_remove(struct platform_device *pdev)
 	reset_control_assert(dmac->rstc);
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static const struct of_device_id of_rz_dmac_match[] = {
@@ -1003,7 +1001,7 @@ static struct platform_driver rz_dmac_driver = {
 		.of_match_table = of_rz_dmac_match,
 	},
 	.probe		= rz_dmac_probe,
-	.remove		= rz_dmac_remove,
+	.remove_new	= rz_dmac_remove,
 };
 
 module_platform_driver(rz_dmac_driver);
-- 
2.40.1


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

* [PATCH 41/59] dma: sh: shdmac: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (39 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 40/59] dma: sh: rz-dmac: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 42/59] dma: sh: usb-dmac: " Uwe Kleine-König
                   ` (19 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Yangtao Li, Rob Herring, 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/sh/shdmac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c
index 00067b29e232..7cc9eb2217e8 100644
--- a/drivers/dma/sh/shdmac.c
+++ b/drivers/dma/sh/shdmac.c
@@ -882,7 +882,7 @@ static int sh_dmae_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int sh_dmae_remove(struct platform_device *pdev)
+static void sh_dmae_remove(struct platform_device *pdev)
 {
 	struct sh_dmae_device *shdev = platform_get_drvdata(pdev);
 	struct dma_device *dma_dev = &shdev->shdma_dev.dma_dev;
@@ -899,8 +899,6 @@ static int sh_dmae_remove(struct platform_device *pdev)
 	shdma_cleanup(&shdev->shdma_dev);
 
 	synchronize_rcu();
-
-	return 0;
 }
 
 static struct platform_driver sh_dmae_driver = {
@@ -908,7 +906,7 @@ static struct platform_driver sh_dmae_driver = {
 		.pm	= &sh_dmae_pm,
 		.name	= SH_DMAE_DRV_NAME,
 	},
-	.remove		= sh_dmae_remove,
+	.remove_new	= sh_dmae_remove,
 };
 
 static int __init sh_dmae_init(void)
-- 
2.40.1


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

* [PATCH 42/59] dma: sh: usb-dmac: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (40 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 41/59] dma: sh: shdmac: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 43/59] dma: sprd-dma: " Uwe Kleine-König
                   ` (18 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Peter Ujfalusi, Tudor Ambarus, Jernej Skrabec, 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/sh/usb-dmac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c
index b14cf350b669..d8c93faa424d 100644
--- a/drivers/dma/sh/usb-dmac.c
+++ b/drivers/dma/sh/usb-dmac.c
@@ -866,7 +866,7 @@ static void usb_dmac_chan_remove(struct usb_dmac *dmac,
 	devm_free_irq(dmac->dev, uchan->irq, uchan);
 }
 
-static int usb_dmac_remove(struct platform_device *pdev)
+static void usb_dmac_remove(struct platform_device *pdev)
 {
 	struct usb_dmac *dmac = platform_get_drvdata(pdev);
 	int i;
@@ -877,8 +877,6 @@ static int usb_dmac_remove(struct platform_device *pdev)
 	dma_async_device_unregister(&dmac->engine);
 
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static void usb_dmac_shutdown(struct platform_device *pdev)
@@ -901,7 +899,7 @@ static struct platform_driver usb_dmac_driver = {
 		.of_match_table = usb_dmac_of_ids,
 	},
 	.probe		= usb_dmac_probe,
-	.remove		= usb_dmac_remove,
+	.remove_new	= usb_dmac_remove,
 	.shutdown	= usb_dmac_shutdown,
 };
 
-- 
2.40.1


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

* [PATCH 43/59] dma: sprd-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (41 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 42/59] dma: sh: usb-dmac: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 44/59] dma: st_fdma: " Uwe Kleine-König
                   ` (17 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Orson Zhai, Baolin Wang, Chunyan Zhang, 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/sprd-dma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 168aa0bd73a0..97e3dedb6c12 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -1232,7 +1232,7 @@ static int sprd_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sprd_dma_remove(struct platform_device *pdev)
+static void sprd_dma_remove(struct platform_device *pdev)
 {
 	struct sprd_dma_dev *sdev = platform_get_drvdata(pdev);
 	struct sprd_dma_chn *c, *cn;
@@ -1255,7 +1255,6 @@ static int sprd_dma_remove(struct platform_device *pdev)
 
 	pm_runtime_put_noidle(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-	return 0;
 }
 
 static const struct of_device_id sprd_dma_match[] = {
@@ -1292,7 +1291,7 @@ static const struct dev_pm_ops sprd_dma_pm_ops = {
 
 static struct platform_driver sprd_dma_driver = {
 	.probe = sprd_dma_probe,
-	.remove = sprd_dma_remove,
+	.remove_new = sprd_dma_remove,
 	.driver = {
 		.name = "sprd-dma",
 		.of_match_table = sprd_dma_match,
-- 
2.40.1


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

* [PATCH 44/59] dma: st_fdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (42 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 43/59] dma: sprd-dma: " 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
                   ` (16 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 45/59] dma: sun4i-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (43 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
                   ` (15 subsequent siblings)
  60 siblings, 1 reply; 82+ 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


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

* [PATCH 46/59] dma: sun6i-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (44 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:31 ` [PATCH 47/59] dma: tegra186-gpc-dma: " Uwe Kleine-König
                   ` (14 subsequent siblings)
  60 siblings, 1 reply; 82+ 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


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

* [PATCH 47/59] dma: tegra186-gpc-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (45 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 46/59] dma: sun6i-dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 48/59] dma: tegra20-apb-dma: " Uwe Kleine-König
                   ` (13 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Laxman Dewangan, Jon Hunter, Thierry Reding, dmaengine,
	linux-tegra, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is 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/tegra186-gpc-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/tegra186-gpc-dma.c b/drivers/dma/tegra186-gpc-dma.c
index 33b101001100..868c18cc72b1 100644
--- a/drivers/dma/tegra186-gpc-dma.c
+++ b/drivers/dma/tegra186-gpc-dma.c
@@ -1473,14 +1473,12 @@ static int tegra_dma_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int tegra_dma_remove(struct platform_device *pdev)
+static void tegra_dma_remove(struct platform_device *pdev)
 {
 	struct tegra_dma *tdma = platform_get_drvdata(pdev);
 
 	of_dma_controller_free(pdev->dev.of_node);
 	dma_async_device_unregister(&tdma->dma_dev);
-
-	return 0;
 }
 
 static int __maybe_unused tegra_dma_pm_suspend(struct device *dev)
@@ -1533,7 +1531,7 @@ static struct platform_driver tegra_dma_driver = {
 		.of_match_table = tegra_dma_of_match,
 	},
 	.probe		= tegra_dma_probe,
-	.remove		= tegra_dma_remove,
+	.remove_new	= tegra_dma_remove,
 };
 
 module_platform_driver(tegra_dma_driver);
-- 
2.40.1


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

* [PATCH 48/59] dma: tegra20-apb-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (46 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 47/59] dma: tegra186-gpc-dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 49/59] dma: tegra210-adma: " Uwe Kleine-König
                   ` (12 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Laxman Dewangan, Jon Hunter, Thierry Reding, dmaengine,
	linux-tegra, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is 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/tegra20-apb-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 063022f9df76..ac69778827f2 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1581,7 +1581,7 @@ static int tegra_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tegra_dma_remove(struct platform_device *pdev)
+static void tegra_dma_remove(struct platform_device *pdev)
 {
 	struct tegra_dma *tdma = platform_get_drvdata(pdev);
 
@@ -1589,8 +1589,6 @@ static int tegra_dma_remove(struct platform_device *pdev)
 	dma_async_device_unregister(&tdma->dma_dev);
 	pm_runtime_disable(&pdev->dev);
 	clk_unprepare(tdma->dma_clk);
-
-	return 0;
 }
 
 static int __maybe_unused tegra_dma_runtime_suspend(struct device *dev)
@@ -1677,7 +1675,7 @@ static struct platform_driver tegra_dmac_driver = {
 		.of_match_table = tegra_dma_of_match,
 	},
 	.probe		= tegra_dma_probe,
-	.remove		= tegra_dma_remove,
+	.remove_new	= tegra_dma_remove,
 };
 
 module_platform_driver(tegra_dmac_driver);
-- 
2.40.1


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

* [PATCH 49/59] dma: tegra210-adma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (47 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 48/59] dma: tegra20-apb-dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 50/59] dma: ti: cppi41: " Uwe Kleine-König
                   ` (11 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Laxman Dewangan, Jon Hunter, Thierry Reding, dmaengine,
	linux-tegra, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is 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/tegra210-adma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index e557bada1510..60111d40325e 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -949,7 +949,7 @@ static int tegra_adma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tegra_adma_remove(struct platform_device *pdev)
+static void tegra_adma_remove(struct platform_device *pdev)
 {
 	struct tegra_adma *tdma = platform_get_drvdata(pdev);
 	int i;
@@ -961,8 +961,6 @@ static int tegra_adma_remove(struct platform_device *pdev)
 		irq_dispose_mapping(tdma->channels[i].irq);
 
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static const struct dev_pm_ops tegra_adma_dev_pm_ops = {
@@ -979,7 +977,7 @@ static struct platform_driver tegra_admac_driver = {
 		.of_match_table = tegra_adma_of_match,
 	},
 	.probe		= tegra_adma_probe,
-	.remove		= tegra_adma_remove,
+	.remove_new	= tegra_adma_remove,
 };
 
 module_platform_driver(tegra_admac_driver);
-- 
2.40.1


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

* [PATCH 50/59] dma: ti: cppi41: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (48 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 49/59] dma: tegra210-adma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-20 17:55   ` Péter Ujfalusi
  2023-09-19 13:31 ` [PATCH 51/59] dma: ti: edma: " Uwe Kleine-König
                   ` (10 subsequent siblings)
  60 siblings, 1 reply; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Peter Ujfalusi, Tudor Ambarus, Jernej Skrabec, 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/ti/cppi41.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/ti/cppi41.c b/drivers/dma/ti/cppi41.c
index c3555cfb0681..7e0b06b5dff0 100644
--- a/drivers/dma/ti/cppi41.c
+++ b/drivers/dma/ti/cppi41.c
@@ -1156,7 +1156,7 @@ static int cppi41_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int cppi41_dma_remove(struct platform_device *pdev)
+static void cppi41_dma_remove(struct platform_device *pdev)
 {
 	struct cppi41_dd *cdd = platform_get_drvdata(pdev);
 	int error;
@@ -1173,7 +1173,6 @@ static int cppi41_dma_remove(struct platform_device *pdev)
 	pm_runtime_dont_use_autosuspend(&pdev->dev);
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-	return 0;
 }
 
 static int __maybe_unused cppi41_suspend(struct device *dev)
@@ -1244,7 +1243,7 @@ static const struct dev_pm_ops cppi41_pm_ops = {
 
 static struct platform_driver cpp41_dma_driver = {
 	.probe  = cppi41_dma_probe,
-	.remove = cppi41_dma_remove,
+	.remove_new = cppi41_dma_remove,
 	.driver = {
 		.name = "cppi41-dma-engine",
 		.pm = &cppi41_pm_ops,
-- 
2.40.1


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

* [PATCH 51/59] dma: ti: edma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (49 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 50/59] dma: ti: cppi41: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-20 17:54   ` Péter Ujfalusi
  2023-09-19 13:32 ` [PATCH 52/59] dma: ti: omap-dma: " Uwe Kleine-König
                   ` (9 subsequent siblings)
  60 siblings, 1 reply; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Peter Ujfalusi, 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/ti/edma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
index aa8e2e8ac260..3ed022918ec0 100644
--- a/drivers/dma/ti/edma.c
+++ b/drivers/dma/ti/edma.c
@@ -2550,7 +2550,7 @@ static void edma_cleanupp_vchan(struct dma_device *dmadev)
 	}
 }
 
-static int edma_remove(struct platform_device *pdev)
+static void edma_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct edma_cc *ecc = dev_get_drvdata(dev);
@@ -2568,8 +2568,6 @@ static int edma_remove(struct platform_device *pdev)
 	edma_free_slot(ecc, ecc->dummy_slot);
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -2628,7 +2626,7 @@ static const struct dev_pm_ops edma_pm_ops = {
 
 static struct platform_driver edma_driver = {
 	.probe		= edma_probe,
-	.remove		= edma_remove,
+	.remove_new	= edma_remove,
 	.driver = {
 		.name	= "edma",
 		.pm	= &edma_pm_ops,
-- 
2.40.1


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

* [PATCH 52/59] dma: ti: omap-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (50 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 51/59] dma: ti: edma: " Uwe Kleine-König
@ 2023-09-19 13:32 ` Uwe Kleine-König
  2023-09-20 17:54   ` Péter Ujfalusi
  2023-09-19 13:32 ` [PATCH 53/59] dma: timb_dma: " Uwe Kleine-König
                   ` (8 subsequent siblings)
  60 siblings, 1 reply; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:32 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Peter Ujfalusi, 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/ti/omap-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c
index cf96cf915c0c..76db0fc19524 100644
--- a/drivers/dma/ti/omap-dma.c
+++ b/drivers/dma/ti/omap-dma.c
@@ -1844,7 +1844,7 @@ static int omap_dma_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static int omap_dma_remove(struct platform_device *pdev)
+static void omap_dma_remove(struct platform_device *pdev)
 {
 	struct omap_dmadev *od = platform_get_drvdata(pdev);
 	int irq;
@@ -1869,8 +1869,6 @@ static int omap_dma_remove(struct platform_device *pdev)
 		dma_pool_destroy(od->desc_pool);
 
 	omap_dma_free(od);
-
-	return 0;
 }
 
 static const struct omap_dma_config omap2420_data = {
@@ -1918,7 +1916,7 @@ MODULE_DEVICE_TABLE(of, omap_dma_match);
 
 static struct platform_driver omap_dma_driver = {
 	.probe	= omap_dma_probe,
-	.remove	= omap_dma_remove,
+	.remove_new = omap_dma_remove,
 	.driver = {
 		.name = "omap-dma-engine",
 		.of_match_table = omap_dma_match,
-- 
2.40.1


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

* [PATCH 53/59] dma: timb_dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (51 preceding siblings ...)
  2023-09-19 13:32 ` [PATCH 52/59] dma: ti: omap-dma: " Uwe Kleine-König
@ 2023-09-19 13:32 ` Uwe Kleine-König
  2023-09-19 13:32 ` [PATCH 54/59] dma: txx9dmac: " Uwe Kleine-König
                   ` (7 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:32 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/timb_dma.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index 3f524be69efb..7410025605e0 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -740,7 +740,7 @@ static int td_probe(struct platform_device *pdev)
 
 }
 
-static int td_remove(struct platform_device *pdev)
+static void td_remove(struct platform_device *pdev)
 {
 	struct timb_dma *td = platform_get_drvdata(pdev);
 	struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -754,7 +754,6 @@ static int td_remove(struct platform_device *pdev)
 	release_mem_region(iomem->start, resource_size(iomem));
 
 	dev_dbg(&pdev->dev, "Removed...\n");
-	return 0;
 }
 
 static struct platform_driver td_driver = {
@@ -762,7 +761,7 @@ static struct platform_driver td_driver = {
 		.name	= DRIVER_NAME,
 	},
 	.probe	= td_probe,
-	.remove	= td_remove,
+	.remove_new = td_remove,
 };
 
 module_platform_driver(td_driver);
-- 
2.40.1


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

* [PATCH 54/59] dma: txx9dmac: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (52 preceding siblings ...)
  2023-09-19 13:32 ` [PATCH 53/59] dma: timb_dma: " Uwe Kleine-König
@ 2023-09-19 13:32 ` Uwe Kleine-König
  2023-09-19 13:32 ` [PATCH 55/59] dma: xgene-dma: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:32 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/txx9dmac.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c
index 5b6b375a257e..44ba377b4b5a 100644
--- a/drivers/dma/txx9dmac.c
+++ b/drivers/dma/txx9dmac.c
@@ -1151,7 +1151,7 @@ static int __init txx9dmac_chan_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int txx9dmac_chan_remove(struct platform_device *pdev)
+static void txx9dmac_chan_remove(struct platform_device *pdev)
 {
 	struct txx9dmac_chan *dc = platform_get_drvdata(pdev);
 
@@ -1162,7 +1162,6 @@ static int txx9dmac_chan_remove(struct platform_device *pdev)
 		tasklet_kill(&dc->tasklet);
 	}
 	dc->ddev->chan[pdev->id % TXX9_DMA_MAX_NR_CHANNELS] = NULL;
-	return 0;
 }
 
 static int __init txx9dmac_probe(struct platform_device *pdev)
@@ -1215,7 +1214,7 @@ static int __init txx9dmac_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int txx9dmac_remove(struct platform_device *pdev)
+static void txx9dmac_remove(struct platform_device *pdev)
 {
 	struct txx9dmac_dev *ddev = platform_get_drvdata(pdev);
 
@@ -1224,7 +1223,6 @@ static int txx9dmac_remove(struct platform_device *pdev)
 		devm_free_irq(&pdev->dev, ddev->irq, ddev);
 		tasklet_kill(&ddev->tasklet);
 	}
-	return 0;
 }
 
 static void txx9dmac_shutdown(struct platform_device *pdev)
@@ -1262,14 +1260,14 @@ static const struct dev_pm_ops txx9dmac_dev_pm_ops = {
 };
 
 static struct platform_driver txx9dmac_chan_driver = {
-	.remove		= txx9dmac_chan_remove,
+	.remove_new	= txx9dmac_chan_remove,
 	.driver = {
 		.name	= "txx9dmac-chan",
 	},
 };
 
 static struct platform_driver txx9dmac_driver = {
-	.remove		= txx9dmac_remove,
+	.remove_new	= txx9dmac_remove,
 	.shutdown	= txx9dmac_shutdown,
 	.driver = {
 		.name	= "txx9dmac",
-- 
2.40.1


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

* [PATCH 55/59] dma: xgene-dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (53 preceding siblings ...)
  2023-09-19 13:32 ` [PATCH 54/59] dma: txx9dmac: " Uwe Kleine-König
@ 2023-09-19 13:32 ` Uwe Kleine-König
  2023-09-19 13:32 ` [PATCH 56/59] dma: xilinx: xdma: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  60 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:32 UTC (permalink / raw)
  To: Vinod Koul; +Cc: 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/xgene-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
index bb4ff8c86733..fd4397adeb79 100644
--- a/drivers/dma/xgene-dma.c
+++ b/drivers/dma/xgene-dma.c
@@ -1776,7 +1776,7 @@ static int xgene_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int xgene_dma_remove(struct platform_device *pdev)
+static void xgene_dma_remove(struct platform_device *pdev)
 {
 	struct xgene_dma *pdma = platform_get_drvdata(pdev);
 	struct xgene_dma_chan *chan;
@@ -1797,8 +1797,6 @@ static int xgene_dma_remove(struct platform_device *pdev)
 
 	if (!IS_ERR(pdma->clk))
 		clk_disable_unprepare(pdma->clk);
-
-	return 0;
 }
 
 #ifdef CONFIG_ACPI
@@ -1817,7 +1815,7 @@ MODULE_DEVICE_TABLE(of, xgene_dma_of_match_ptr);
 
 static struct platform_driver xgene_dma_driver = {
 	.probe = xgene_dma_probe,
-	.remove = xgene_dma_remove,
+	.remove_new = xgene_dma_remove,
 	.driver = {
 		.name = "X-Gene-DMA",
 		.of_match_table = xgene_dma_of_match_ptr,
-- 
2.40.1


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

* [PATCH 56/59] dma: xilinx: xdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (54 preceding siblings ...)
  2023-09-19 13:32 ` [PATCH 55/59] dma: xgene-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
                   ` (4 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 57/59] dma: xilinx: xilinx_dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (55 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
                   ` (3 subsequent siblings)
  60 siblings, 1 reply; 82+ 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


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

* [PATCH 58/59] dma: xilinx: xilinx_dpdma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (56 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
                   ` (2 subsequent siblings)
  60 siblings, 0 replies; 82+ 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


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

* [PATCH 59/59] dma: xilinx: zynqmp_dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (57 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
  2023-09-28  7:46 ` [PATCH 00/59] dma: " Vinod Koul
  2023-09-28  7:49 ` Vinod Koul
  60 siblings, 0 replies; 82+ 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


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

* Re: [PATCH 40/59] dma: sh: rz-dmac: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 40/59] dma: sh: rz-dmac: " Uwe Kleine-König
@ 2023-09-19 13:35   ` Geert Uytterhoeven
  0 siblings, 0 replies; 82+ messages in thread
From: Geert Uytterhoeven @ 2023-09-19 13:35 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Vinod Koul, Biju Das, Geert Uytterhoeven, Lad Prabhakar,
	Pavel Machek, Hien Huynh, dmaengine, kernel

On Tue, Sep 19, 2023 at 3:32 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is 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: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 09/59] dma: dma-jz4780: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 09/59] dma: dma-jz4780: " Uwe Kleine-König
@ 2023-09-19 13:39   ` Paul Cercueil
  2023-09-19 14:48     ` Uwe Kleine-König
  2023-09-20 15:44   ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 82+ messages in thread
From: Paul Cercueil @ 2023-09-19 13:39 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul; +Cc: linux-mips, dmaengine, kernel

Hi Uwe,

Le mardi 19 septembre 2023 à 15:31 +0200, Uwe Kleine-König a écrit :
> 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().

"is renamed" -> "will be renamed"?

> 
> 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: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul

> ---
>  drivers/dma/dma-jz4780.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
> index adbd47bd6adf..c9cfa341db51 100644
> --- a/drivers/dma/dma-jz4780.c
> +++ b/drivers/dma/dma-jz4780.c
> @@ -1008,7 +1008,7 @@ static int jz4780_dma_probe(struct
> platform_device *pdev)
>         return ret;
>  }
>  
> -static int jz4780_dma_remove(struct platform_device *pdev)
> +static void jz4780_dma_remove(struct platform_device *pdev)
>  {
>         struct jz4780_dma_dev *jzdma = platform_get_drvdata(pdev);
>         int i;
> @@ -1020,8 +1020,6 @@ static int jz4780_dma_remove(struct
> platform_device *pdev)
>  
>         for (i = 0; i < jzdma->soc_data->nb_channels; i++)
>                 tasklet_kill(&jzdma->chan[i].vchan.task);
> -
> -       return 0;
>  }
>  
>  static const struct jz4780_dma_soc_data jz4740_dma_soc_data = {
> @@ -1124,7 +1122,7 @@ MODULE_DEVICE_TABLE(of, jz4780_dma_dt_match);
>  
>  static struct platform_driver jz4780_dma_driver = {
>         .probe          = jz4780_dma_probe,
> -       .remove         = jz4780_dma_remove,
> +       .remove_new     = jz4780_dma_remove,
>         .driver = {
>                 .name   = "jz4780-dma",
>                 .of_match_table = jz4780_dma_dt_match,


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

* Re: [PATCH 09/59] dma: dma-jz4780: Convert to platform remove callback returning void
  2023-09-19 13:39   ` Paul Cercueil
@ 2023-09-19 14:48     ` Uwe Kleine-König
  0 siblings, 0 replies; 82+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 14:48 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Vinod Koul, dmaengine, linux-mips, kernel

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

On Tue, Sep 19, 2023 at 03:39:10PM +0200, Paul Cercueil wrote:
> Hi Uwe,
> 
> Le mardi 19 septembre 2023 à 15:31 +0200, Uwe Kleine-König a écrit :
> > 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().
> 
> "is renamed" -> "will be renamed"?

I guess you're right here. I fixed that in my template, but I won't
resend this series (and the others with the same issue) for now.

Thanks
Uwe

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

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

^ permalink raw reply	[flat|nested] 82+ 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; 82+ 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,





^ permalink raw reply	[flat|nested] 82+ 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; 82+ 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,





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

* Re: [PATCH 34/59] dma: qcom: bam_dma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 34/59] dma: qcom: bam_dma: " Uwe Kleine-König
@ 2023-09-19 21:02   ` Konrad Dybcio
  0 siblings, 0 replies; 82+ messages in thread
From: Konrad Dybcio @ 2023-09-19 21:02 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, 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

^ permalink raw reply	[flat|nested] 82+ 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; 82+ 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

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

* Re: [PATCH 36/59] dma: qcom: qcom_adm: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 36/59] dma: qcom: qcom_adm: " Uwe Kleine-König
@ 2023-09-19 21:02   ` Konrad Dybcio
  0 siblings, 0 replies; 82+ messages in thread
From: Konrad Dybcio @ 2023-09-19 21:02 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, 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

^ permalink raw reply	[flat|nested] 82+ 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; 82+ 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>


^ permalink raw reply	[flat|nested] 82+ 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; 82+ 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>


^ permalink raw reply	[flat|nested] 82+ 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; 82+ 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>



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

* Re: [PATCH 09/59] dma: dma-jz4780: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 09/59] dma: dma-jz4780: " Uwe Kleine-König
  2023-09-19 13:39   ` Paul Cercueil
@ 2023-09-20 15:44   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 82+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-20 15:44 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Paul Cercueil, linux-mips, dmaengine, kernel

On 19/9/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>
> ---
>   drivers/dma/dma-jz4780.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


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

* Re: [PATCH 51/59] dma: ti: edma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 51/59] dma: ti: edma: " Uwe Kleine-König
@ 2023-09-20 17:54   ` Péter Ujfalusi
  0 siblings, 0 replies; 82+ messages in thread
From: Péter Ujfalusi @ 2023-09-20 17:54 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul; +Cc: dmaengine, kernel



On 9/19/23 16: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.

Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>

> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/dma/ti/edma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index aa8e2e8ac260..3ed022918ec0 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -2550,7 +2550,7 @@ static void edma_cleanupp_vchan(struct dma_device *dmadev)
>  	}
>  }
>  
> -static int edma_remove(struct platform_device *pdev)
> +static void edma_remove(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  	struct edma_cc *ecc = dev_get_drvdata(dev);
> @@ -2568,8 +2568,6 @@ static int edma_remove(struct platform_device *pdev)
>  	edma_free_slot(ecc, ecc->dummy_slot);
>  	pm_runtime_put_sync(dev);
>  	pm_runtime_disable(dev);
> -
> -	return 0;
>  }
>  
>  #ifdef CONFIG_PM_SLEEP
> @@ -2628,7 +2626,7 @@ static const struct dev_pm_ops edma_pm_ops = {
>  
>  static struct platform_driver edma_driver = {
>  	.probe		= edma_probe,
> -	.remove		= edma_remove,
> +	.remove_new	= edma_remove,
>  	.driver = {
>  		.name	= "edma",
>  		.pm	= &edma_pm_ops,

-- 
Péter

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

* Re: [PATCH 52/59] dma: ti: omap-dma: Convert to platform remove callback returning void
  2023-09-19 13:32 ` [PATCH 52/59] dma: ti: omap-dma: " Uwe Kleine-König
@ 2023-09-20 17:54   ` Péter Ujfalusi
  0 siblings, 0 replies; 82+ messages in thread
From: Péter Ujfalusi @ 2023-09-20 17:54 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul; +Cc: dmaengine, kernel



On 9/19/23 16:32, 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.

Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>

> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/dma/ti/omap-dma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c
> index cf96cf915c0c..76db0fc19524 100644
> --- a/drivers/dma/ti/omap-dma.c
> +++ b/drivers/dma/ti/omap-dma.c
> @@ -1844,7 +1844,7 @@ static int omap_dma_probe(struct platform_device *pdev)
>  	return rc;
>  }
>  
> -static int omap_dma_remove(struct platform_device *pdev)
> +static void omap_dma_remove(struct platform_device *pdev)
>  {
>  	struct omap_dmadev *od = platform_get_drvdata(pdev);
>  	int irq;
> @@ -1869,8 +1869,6 @@ static int omap_dma_remove(struct platform_device *pdev)
>  		dma_pool_destroy(od->desc_pool);
>  
>  	omap_dma_free(od);
> -
> -	return 0;
>  }
>  
>  static const struct omap_dma_config omap2420_data = {
> @@ -1918,7 +1916,7 @@ MODULE_DEVICE_TABLE(of, omap_dma_match);
>  
>  static struct platform_driver omap_dma_driver = {
>  	.probe	= omap_dma_probe,
> -	.remove	= omap_dma_remove,
> +	.remove_new = omap_dma_remove,
>  	.driver = {
>  		.name = "omap-dma-engine",
>  		.of_match_table = omap_dma_match,

-- 
Péter

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

* Re: [PATCH 50/59] dma: ti: cppi41: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 50/59] dma: ti: cppi41: " Uwe Kleine-König
@ 2023-09-20 17:55   ` Péter Ujfalusi
  0 siblings, 0 replies; 82+ messages in thread
From: Péter Ujfalusi @ 2023-09-20 17:55 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Tudor Ambarus, Jernej Skrabec, dmaengine, kernel



On 9/19/23 16: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.

Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>

> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/dma/ti/cppi41.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/ti/cppi41.c b/drivers/dma/ti/cppi41.c
> index c3555cfb0681..7e0b06b5dff0 100644
> --- a/drivers/dma/ti/cppi41.c
> +++ b/drivers/dma/ti/cppi41.c
> @@ -1156,7 +1156,7 @@ static int cppi41_dma_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int cppi41_dma_remove(struct platform_device *pdev)
> +static void cppi41_dma_remove(struct platform_device *pdev)
>  {
>  	struct cppi41_dd *cdd = platform_get_drvdata(pdev);
>  	int error;
> @@ -1173,7 +1173,6 @@ static int cppi41_dma_remove(struct platform_device *pdev)
>  	pm_runtime_dont_use_autosuspend(&pdev->dev);
>  	pm_runtime_put_sync(&pdev->dev);
>  	pm_runtime_disable(&pdev->dev);
> -	return 0;
>  }
>  
>  static int __maybe_unused cppi41_suspend(struct device *dev)
> @@ -1244,7 +1243,7 @@ static const struct dev_pm_ops cppi41_pm_ops = {
>  
>  static struct platform_driver cpp41_dma_driver = {
>  	.probe  = cppi41_dma_probe,
> -	.remove = cppi41_dma_remove,
> +	.remove_new = cppi41_dma_remove,
>  	.driver = {
>  		.name = "cppi41-dma-engine",
>  		.pm = &cppi41_pm_ops,

-- 
Péter

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

* Re: [PATCH 01/59] dma: altera-msgdma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 01/59] dma: altera-msgdma: " Uwe Kleine-König
@ 2023-09-20 18:13   ` Olivier Dautricourt
  0 siblings, 0 replies; 82+ messages in thread
From: Olivier Dautricourt @ 2023-09-20 18:13 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Vinod Koul, Stefan Roese, dmaengine, kernel

On Tue, Sep 19, 2023 at 03:31:09PM +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() is renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.

Acked-by: Olivier Dautricourt <olivierdautricourt@gmail.com>

Thanks

> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/dma/altera-msgdma.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/altera-msgdma.c b/drivers/dma/altera-msgdma.c
> index 4153c2edb049..a8e3615235b8 100644
> --- a/drivers/dma/altera-msgdma.c
> +++ b/drivers/dma/altera-msgdma.c
> @@ -923,7 +923,7 @@ static int msgdma_probe(struct platform_device *pdev)
>   *
>   * Return: Always '0'
>   */
> -static int msgdma_remove(struct platform_device *pdev)
> +static void msgdma_remove(struct platform_device *pdev)
>  {
>  	struct msgdma_device *mdev = platform_get_drvdata(pdev);
>  
> @@ -933,8 +933,6 @@ static int msgdma_remove(struct platform_device *pdev)
>  	msgdma_dev_remove(mdev);
>  
>  	dev_notice(&pdev->dev, "Altera mSGDMA driver removed\n");
> -
> -	return 0;
>  }
>  
>  #ifdef CONFIG_OF
> @@ -952,7 +950,7 @@ static struct platform_driver msgdma_driver = {
>  		.of_match_table = of_match_ptr(msgdma_match),
>  	},
>  	.probe = msgdma_probe,
> -	.remove = msgdma_remove,
> +	.remove_new = msgdma_remove,
>  };
>  
>  module_platform_driver(msgdma_driver);
> -- 
> 2.40.1
> 

^ permalink raw reply	[flat|nested] 82+ 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; 82+ 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


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

* Re: [PATCH 11/59] dma: dw: platform: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 11/59] dma: dw: platform: " Uwe Kleine-König
@ 2023-09-28  7:09   ` Viresh Kumar
  0 siblings, 0 replies; 82+ messages in thread
From: Viresh Kumar @ 2023-09-28  7:09 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Vinod Koul, Viresh Kumar, Andy Shevchenko, dmaengine, kernel

On 19-09-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>
> ---
>  drivers/dma/dw/platform.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
> index 47f2292dba98..7d9d4c951724 100644
> --- a/drivers/dma/dw/platform.c
> +++ b/drivers/dma/dw/platform.c
> @@ -93,7 +93,7 @@ static int dw_probe(struct platform_device *pdev)
>  	return err;
>  }
>  
> -static int dw_remove(struct platform_device *pdev)
> +static void dw_remove(struct platform_device *pdev)
>  {
>  	struct dw_dma_chip_pdata *data = platform_get_drvdata(pdev);
>  	struct dw_dma_chip *chip = data->chip;
> @@ -109,8 +109,6 @@ static int dw_remove(struct platform_device *pdev)
>  
>  	pm_runtime_disable(&pdev->dev);
>  	clk_disable_unprepare(chip->clk);
> -
> -	return 0;
>  }
>  
>  static void dw_shutdown(struct platform_device *pdev)
> @@ -193,7 +191,7 @@ static const struct dev_pm_ops dw_dev_pm_ops = {
>  
>  static struct platform_driver dw_driver = {
>  	.probe		= dw_probe,
> -	.remove		= dw_remove,
> +	.remove_new	= dw_remove,
>  	.shutdown       = dw_shutdown,
>  	.driver = {
>  		.name	= DRV_NAME,

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 82+ 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; 82+ 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: 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 00/59] dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (58 preceding siblings ...)
  2023-09-19 13:32 ` [PATCH 59/59] dma: xilinx: zynqmp_dma: " Uwe Kleine-König
@ 2023-09-28  7:46 ` Vinod Koul
  2023-09-28  7:49 ` Vinod Koul
  60 siblings, 0 replies; 82+ messages in thread
From: Vinod Koul @ 2023-09-28  7:46 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Olivier Dautricourt, Stefan Roese, dmaengine, kernel,
	Hector Martin, Sven Peter, Alyssa Rosenzweig, asahi,
	linux-arm-kernel, Ludovic Desroches, Tudor Ambarus,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, linux-rpi-kernel, Rob Herring, Lars-Peter Clausen,
	Paul Cercueil, linux-mips, Eugeniy Paltsev, Viresh Kumar,
	Andy Shevchenko, Li Yang, Zhang Wei, linuxppc-dev, Shawn Guo,
	Sascha Hauer, Fabio Estevam, NXP Linux Team, Sean Wang,
	Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek,
	Andreas Färber, Manivannan Sadhasivam, linux-actions,
	ye xingchen, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Sinan Kaya, Green Wan, Kees Cook, Gustavo A. R. Silva, Biju Das,
	Geert Uytterhoeven, Lad Prabhakar, Pavel Machek, Hien Huynh,
	Yangtao Li, Peter Ujfalusi, Jernej Skrabec, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Patrice Chotard, Chen-Yu Tsai,
	Samuel Holland, linux-sunxi, Laxman Dewangan, Jon Hunter,
	Thierry Reding, linux-tegra, Lizhi Hou, Brian Xu,
	Raj Kumar Rampelli, Michal Simek, Radhey Shyam Pandey,
	Peter Korsgaard, Liu Shixin, Laurent Pinchart, Harini Katakam,
	Swati Agarwal


On Tue, 19 Sep 2023 15:31:08 +0200, Uwe Kleine-König wrote:
> this series convert nearly all platform drivers below drivers/dma to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.
> 
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
> 
> [...]

Applied, thanks!

[01/59] dma: altera-msgdma: Convert to platform remove callback returning void
        commit: 8876762f285fff08b1aefeba52c7157a2c9beec1
[02/59] dma: apple-admac: Convert to platform remove callback returning void
        commit: e7d5aa30c8a19e6d9c4ec19d3b9e501df22e1d1a
[03/59] dma: at_hdmac: Convert to platform remove callback returning void
        commit: ae3f38e495b42494414cbace3b3bd3cb6dc10506
[04/59] dma: at_xdmac: Convert to platform remove callback returning void
        commit: b13af3c41bad5f4e45a73d6978f31ad48ffc2dee
[05/59] dma: bcm-sba-raid: Convert to platform remove callback returning void
        commit: 017df796a3635edee5169a0700634da6dac92f6a
[06/59] dma: bcm2835-dma: Convert to platform remove callback returning void
        commit: 8f63a2da288454e9228f6b438b86627f6ceae36b
[07/59] dma: bestcomm: bestcomm: Convert to platform remove callback returning void
        commit: 7689bca111997e0d7a12cf6457fc26a52b8c800f
[08/59] dma: dma-axi-dmac: Convert to platform remove callback returning void
        commit: b5f095a70117629c3abb49bcb07dfa954d275e99
[09/59] dma: dma-jz4780: Convert to platform remove callback returning void
        commit: a8c85540bee12d492904a430c0c1105a4b7b101c
[10/59] dma: dw-axi-dmac: dw-axi-dmac-platform: Convert to platform remove callback returning void
        commit: c689a2fd2a3f2a0a9e775c59c0f02ea64677c254
[11/59] dma: dw: platform: Convert to platform remove callback returning void
        commit: 67572bfe2e35c232c3497b3fc8babbfe62600ce0
[12/59] dma: fsl-edma-main: Convert to platform remove callback returning void
        commit: fa13c3ef3f45bca5a1474755dac57bfaf28ef61b
[13/59] dma: fsl-qdma: Convert to platform remove callback returning void
        commit: fe3d44cdaea41173e50833440db84982e2a8d2a7
[14/59] dma: fsl_raid: Convert to platform remove callback returning void
        commit: 37b24b50c5f8ad9037fbe81f1ee43f5e16fb5334
[15/59] dma: fsldma: Convert to platform remove callback returning void
        commit: d69f80110da5d0e665d7f2872bf2185fe7f14409
[16/59] dma: idma64: Convert to platform remove callback returning void
        commit: e8da277fbb8701308cfd2337afb13d34cc233349
[17/59] dma: img-mdc-dma: Convert to platform remove callback returning void
        commit: 6e1b4a907e860071d957baee688a30a0bff102ef
[18/59] dma: imx-dma: Convert to platform remove callback returning void
        commit: 14c49dd0c34e457d71494b04290c27d7a14584d7
[19/59] dma: imx-sdma: Convert to platform remove callback returning void
        commit: 06e4f653fafdeec7b13958b771226efa1cdf76d2
[20/59] dma: k3dma: Convert to platform remove callback returning void
        commit: 3faf902cb808163e9e65bf568c235a272215aed2
[21/59] dma: mcf-edma-main: Convert to platform remove callback returning void
        commit: 48236cb8314238917788f73353290dd1afb9a7c6
[22/59] dma: mediatek: mtk-cqdma: Convert to platform remove callback returning void
        commit: bdeb61f5180efc920cf55b966a2a30bc2336d6d4
[23/59] dma: mediatek: mtk-hsdma: Convert to platform remove callback returning void
        commit: 97283173effa6e53ea698726ea5d07f7ca06e5cf
[24/59] dma: mediatek: mtk-uart-apdma: Convert to platform remove callback returning void
        commit: 4db30945a001ac97b5044db2aa2990b8e7df9452
[25/59] dma: mmp_pdma: Convert to platform remove callback returning void
        commit: c0f0d93fc1da36de564da9b3f0462b5bdc4b1948
[26/59] dma: mmp_tdma: Convert to platform remove callback returning void
        commit: f543b251500a0de589bc4c97da45b88410bf7c56
[27/59] dma: moxart-dma: Convert to platform remove callback returning void
        commit: 1a65831fa037457114ca75ea262d87fbde3158f0
[28/59] dma: mpc512x_dma: Convert to platform remove callback returning void
        commit: 80d0159bbe80d8de6f64c0a8554b4066c66eb378
[29/59] dma: mv_xor_v2: Convert to platform remove callback returning void
        commit: 733dbb8d62f33448c0d7470ba06ce39bdd790ddd
[30/59] dma: nbpfaxi: Convert to platform remove callback returning void
        commit: 44d5338c4a5d7f3f1ef07d502b9db22a29a8756a
[31/59] dma: owl-dma: Convert to platform remove callback returning void
        commit: 1260486a347567c33e0118626bb8778e342e6080
[32/59] dma: ppc4xx: adma: Convert to platform remove callback returning void
        commit: 5f8f212fb416dc3600046955fb008732a512fa5c
[33/59] dma: pxa_dma: Convert to platform remove callback returning void
        commit: 44ea88715d37dc31145b7712b5474808258bab5f
[34/59] dma: qcom: bam_dma: Convert to platform remove callback returning void
        commit: 8d0f1ca5e4037f671cee43a4a582c0f8c6e8e31d
[35/59] dma: qcom: hidma: Convert to platform remove callback returning void
        commit: af9bc3c26b08714eb2309dcbf9a74a6c7af6327f
[36/59] dma: qcom: qcom_adm: Convert to platform remove callback returning void
        commit: 1a6d1c87542d6bb178db5bc2befc9abf99447684
[37/59] dma: sa11x0-dma: Convert to platform remove callback returning void
        commit: d6798037fa1c01e6b9486cc1fbe1b5a272dde477
[38/59] dma: sf-pdma: sf-pdma: Convert to platform remove callback returning void
        commit: 3d97deeb3b3077b3a6f9636f3ea312fef7f54059
[39/59] dma: sh: rcar-dmac: Convert to platform remove callback returning void
        commit: 8ca342994ab8abda069c4b918aab5fa6b8c1614f
[40/59] dma: sh: rz-dmac: Convert to platform remove callback returning void
        commit: bd4205f52310a158c78171d3a5f68c7301a532fd
[41/59] dma: sh: shdmac: Convert to platform remove callback returning void
        commit: 384ba9a683d3ba9f2f598b4c5fbf6f79a9213e94
[42/59] dma: sh: usb-dmac: Convert to platform remove callback returning void
        commit: 9f2812a7fe47c422a367ef95e418dd63fced7238
[43/59] dma: sprd-dma: Convert to platform remove callback returning void
        commit: 8d82eb85a74246afb9b4bc69abf6e79014b06d4f
[44/59] dma: st_fdma: Convert to platform remove callback returning void
        commit: 9c52ffa09f580c49df1cc0b1998d7ea8fdf2c0b4
[45/59] dma: sun4i-dma: Convert to platform remove callback returning void
        commit: 2db76471c8f45837efafdd7d57633aa9f194d787
[46/59] dma: sun6i-dma: Convert to platform remove callback returning void
        commit: 7d6ef7550a4577ae943194421dea73f3df084265
[47/59] dma: tegra186-gpc-dma: Convert to platform remove callback returning void
        commit: d669b198efac1ea97fa39d6f8be59aefe5f39171
[48/59] dma: tegra20-apb-dma: Convert to platform remove callback returning void
        commit: afd1ac2e1b9b39040bb5eedd94b2b152020994e0
[49/59] dma: tegra210-adma: Convert to platform remove callback returning void
        commit: 1a3fa3e369bf54bef0021a8c840567622f52354f
[50/59] dma: ti: cppi41: Convert to platform remove callback returning void
        commit: 36a7e98c36a598c2865daf748a7d9d889a34aaf3
[51/59] dma: ti: edma: Convert to platform remove callback returning void
        commit: 68bcaf5c4e03ada2696b4fbd03ee775781945034
[52/59] dma: ti: omap-dma: Convert to platform remove callback returning void
        commit: 5ea68dc1cee00e5ecf174f2a3ef13d63520971cb
[53/59] dma: timb_dma: Convert to platform remove callback returning void
        commit: 4f339d6efa6a74a16f77fd9a06adf01d9df84734
[54/59] dma: txx9dmac: Convert to platform remove callback returning void
        commit: a3b4af719e571bd899b7952626c2b4d8ec7c0c77
[55/59] dma: xgene-dma: Convert to platform remove callback returning void
        commit: 2c9d879fae9ab1be3d4926ebea5e85305998cf93
[56/59] dma: xilinx: xdma: Convert to platform remove callback returning void
        commit: 78369eb5dc8881d78f163434ee2788a800b89219
[57/59] dma: xilinx: xilinx_dma: Convert to platform remove callback returning void
        commit: cc99582d46b428ba4c2cb7ecd05df4569b02d1f4
[58/59] dma: xilinx: xilinx_dpdma: Convert to platform remove callback returning void
        commit: c962eca73c5cce72936a8b3bd23a24b29852ea97
[59/59] dma: xilinx: zynqmp_dma: Convert to platform remove callback returning void
        commit: b1c50ac25425385b576dd58b7b38c1c5963dde85

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 82+ 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; 82+ 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

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

* Re: [PATCH 00/59] dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (59 preceding siblings ...)
  2023-09-28  7:46 ` [PATCH 00/59] dma: " Vinod Koul
@ 2023-09-28  7:49 ` Vinod Koul
  60 siblings, 0 replies; 82+ messages in thread
From: Vinod Koul @ 2023-09-28  7:49 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Olivier Dautricourt, Stefan Roese, dmaengine, kernel,
	Hector Martin, Sven Peter, Alyssa Rosenzweig, asahi,
	linux-arm-kernel, Ludovic Desroches, Tudor Ambarus,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, linux-rpi-kernel, Rob Herring, Lars-Peter Clausen,
	Paul Cercueil, linux-mips, Eugeniy Paltsev, Viresh Kumar,
	Andy Shevchenko, Li Yang, Zhang Wei, linuxppc-dev, Shawn Guo,
	Sascha Hauer, Fabio Estevam, NXP Linux Team, Sean Wang,
	Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek,
	Andreas Färber, Manivannan Sadhasivam, linux-actions,
	ye xingchen, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Sinan Kaya, Green Wan, Kees Cook, Gustavo A. R. Silva, Biju Das,
	Geert Uytterhoeven, Lad Prabhakar, Pavel Machek, Hien Huynh,
	Yangtao Li, Peter Ujfalusi, Jernej Skrabec, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Patrice Chotard, Chen-Yu Tsai,
	Samuel Holland, linux-sunxi, Laxman Dewangan, Jon Hunter,
	Thierry Reding, linux-tegra, Lizhi Hou, Brian Xu,
	Raj Kumar Rampelli, Michal Simek, Radhey Shyam Pandey,
	Peter Korsgaard, Liu Shixin, Laurent Pinchart, Harini Katakam,
	Swati Agarwal

On 19-09-23, 15:31, Uwe Kleine-König wrote:
> Hello,
> 
> this series convert nearly all platform drivers below drivers/dma to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.

I have applied this, with change of subsystem to dmaengine: xxx
> 
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
> 
> There are 4 drivers I didn't convert in this series:
> 
> 	drivers/dma/milbeaut-hdmac.c
> 	drivers/dma/milbeaut-xdmac.c
> 	drivers/dma/uniphier-mdmac.c
> 	drivers/dma/uniphier-xdmac.c
> 
> These all might return early in .remove() if dmaengine_terminate_sync()
> fails. I only looked deeper into the first one, and this shows exactly
> the error that is easy to make with .remove() returning an int: When
> returning early from .remove(), some cleanup (here:
> dma_async_device_unregister()) is skipped. So the dma device stays
> known, but the device is still unregistered and the devm allocated stuff
> (here e.g. *mdev) is freed. So it can probably easily happen, that
> something tries to use the dma device and this will likely result in an
> oops.

We should convert these too, thanks for your work for the conversion

-- 
~Vinod

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

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

Thread overview: 82+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 01/59] dma: altera-msgdma: " Uwe Kleine-König
2023-09-20 18:13   ` Olivier Dautricourt
2023-09-19 13:31 ` [PATCH 02/59] dma: apple-admac: " 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 05/59] dma: bcm-sba-raid: " 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 07/59] dma: bestcomm: bestcomm: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 08/59] dma: dma-axi-dmac: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 09/59] dma: dma-jz4780: " Uwe Kleine-König
2023-09-19 13:39   ` Paul Cercueil
2023-09-19 14:48     ` Uwe Kleine-König
2023-09-20 15:44   ` Philippe Mathieu-Daudé
2023-09-19 13:31 ` [PATCH 10/59] dma: dw-axi-dmac: dw-axi-dmac-platform: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 11/59] dma: dw: platform: " Uwe Kleine-König
2023-09-28  7:09   ` Viresh Kumar
2023-09-19 13:31 ` [PATCH 12/59] dma: fsl-edma-main: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 13/59] dma: fsl-qdma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 14/59] dma: fsl_raid: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 15/59] dma: fsldma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 16/59] dma: idma64: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 17/59] dma: img-mdc-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 20/59] dma: k3dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 21/59] dma: mcf-edma-main: " 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 25/59] dma: mmp_pdma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 26/59] dma: mmp_tdma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 27/59] dma: moxart-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 28/59] dma: mpc512x_dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 29/59] dma: mv_xor_v2: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 30/59] dma: nbpfaxi: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 31/59] dma: owl-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 32/59] dma: ppc4xx: adma: " 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 34/59] dma: qcom: bam_dma: " Uwe Kleine-König
2023-09-19 21:02   ` Konrad Dybcio
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 36/59] dma: qcom: qcom_adm: " Uwe Kleine-König
2023-09-19 21:02   ` Konrad Dybcio
2023-09-19 13:31 ` [PATCH 37/59] dma: sa11x0-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 38/59] dma: sf-pdma: sf-pdma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 39/59] dma: sh: rcar-dmac: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 40/59] dma: sh: rz-dmac: " Uwe Kleine-König
2023-09-19 13:35   ` Geert Uytterhoeven
2023-09-19 13:31 ` [PATCH 41/59] dma: sh: shdmac: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 42/59] dma: sh: usb-dmac: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 43/59] dma: sprd-dma: " Uwe Kleine-König
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:31 ` [PATCH 47/59] dma: tegra186-gpc-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 48/59] dma: tegra20-apb-dma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 49/59] dma: tegra210-adma: " Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 50/59] dma: ti: cppi41: " Uwe Kleine-König
2023-09-20 17:55   ` Péter Ujfalusi
2023-09-19 13:31 ` [PATCH 51/59] dma: ti: edma: " Uwe Kleine-König
2023-09-20 17:54   ` Péter Ujfalusi
2023-09-19 13:32 ` [PATCH 52/59] dma: ti: omap-dma: " Uwe Kleine-König
2023-09-20 17:54   ` Péter Ujfalusi
2023-09-19 13:32 ` [PATCH 53/59] dma: timb_dma: " Uwe Kleine-König
2023-09-19 13:32 ` [PATCH 54/59] dma: txx9dmac: " Uwe Kleine-König
2023-09-19 13:32 ` [PATCH 55/59] dma: xgene-dma: " Uwe Kleine-König
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
2023-09-28  7:46 ` [PATCH 00/59] dma: " Vinod Koul
2023-09-28  7:49 ` Vinod Koul

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