linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/87] spi: Convert to platform remove callback returning void
@ 2023-03-03 17:19 Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 01/87] spi: ar934x: " Uwe Kleine-König
                   ` (89 more replies)
  0 siblings, 90 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown, Chin-Ting Kuo, Cédric Le Goater, Joel Stanley,
	Radu Pirea, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Tudor Ambarus, Florian Fainelli, Ray Jui, Scott Branden,
	William Zhang, Kursad Oney, Jonas Gorski, Anand Gore,
	Rafał Miłecki, Kamal Dasu, Serge Semin,
	Vladimir Oltean, Han Xu, Andy Gross, Bjorn Andersson, Jay Fang,
	Neil Armstrong, Kevin Hilman, Conor Dooley, Daire McNamara,
	Matthias Brugger, Shawn Guo, Sascha Hauer, Avi Fishman,
	Tomer Maimon, Tali Perry, Haibo Chen, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Heiko Stuebner,
	Krzysztof Kozlowski, Andi Shyti, Palmer Dabbelt, Paul Walmsley,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Maxime Coquelin,
	Alexandre Torgue, Alain Volmat, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Li-hao Kuo, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter,
	Sowjanya Komatineni, Kunihiko Hayashi, Masami Hiramatsu,
	Michal Simek, Max Filippov
  Cc: linux-spi, Andrew Jeffery, linux-aspeed, openbmc,
	linux-arm-kernel, Broadcom internal kernel review list,
	linux-rpi-kernel, Konrad Dybcio, linux-arm-msm, Jerome Brunet,
	Martin Blumenstingl, linux-amlogic, linux-riscv,
	AngeloGioacchino Del Regno, linux-mediatek,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Patrick Venture, Nancy Yuen, Benjamin Fair, Yogesh Gaur,
	linux-rockchip, Alim Akhtar, linux-samsung-soc, linux-stm32,
	linux-sunxi, linux-tegra, linux-xtensa

Hello,

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

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

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

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

Best regards
Uwe

Uwe Kleine-König (87):
  spi: ar934x: Convert to platform remove callback returning void
  spi: armada-3700: Convert to platform remove callback returning void
  spi: aspeed-smc: Convert to platform remove callback returning void
  spi: at91-usart: Convert to platform remove callback returning void
  spi: ath79: Convert to platform remove callback returning void
  spi: atmel: Convert to platform remove callback returning void
  spi: au1550: Convert to platform remove callback returning void
  spi: axi-spi-engine: Convert to platform remove callback returning void
  spi: bcm2835: Convert to platform remove callback returning void
  spi: bcm2835aux: Convert to platform remove callback returning void
  spi: bcm63xx-hsspi: Convert to platform remove callback returning void
  spi: bcm63xx: Convert to platform remove callback returning void
  spi: bcmbca-hsspi: Convert to platform remove callback returning void
  spi: brcmstb-qspi: Convert to platform remove callback returning void
  spi: cadence-quadspi: Convert to platform remove callback returning void
  spi: cadence: Convert to platform remove callback returning void
  spi: cavium-octeon: Convert to platform remove callback returning void
  spi: coldfire-qspi: Convert to platform remove callback returning void
  spi: davinci: Convert to platform remove callback returning void
  spi: dln2: Convert to platform remove callback returning void
  spi: dw-bt1: Convert to platform remove callback returning void
  spi: dw-mmio: Convert to platform remove callback returning void
  spi: ep93xx: Convert to platform remove callback returning void
  spi: fsl-dspi: Convert to platform remove callback returning void
  spi: fsl-espi: Convert to platform remove callback returning void
  spi: fsl-lpspi: Convert to platform remove callback returning void
  spi: fsl-qspi: Convert to platform remove callback returning void
  spi: fsl-spi: Convert to platform remove callback returning void
  spi: geni-qcom: Convert to platform remove callback returning void
  spi: hisi-kunpeng: Convert to platform remove callback returning void
  spi: img-spfi: Convert to platform remove callback returning void
  spi: iproc-qspi: Convert to platform remove callback returning void
  spi: lantiq-ssc: Convert to platform remove callback returning void
  spi: meson-spicc: Convert to platform remove callback returning void
  spi: meson-spifc: Convert to platform remove callback returning void
  spi: microchip-core-qspi: Convert to platform remove callback returning void
  spi: microchip-core: Convert to platform remove callback returning void
  spi: mpc512x-psc: Convert to platform remove callback returning void
  spi: mpc52xx-psc: Convert to platform remove callback returning void
  spi: mpc52xx: Convert to platform remove callback returning void
  spi: mtk-nor: Convert to platform remove callback returning void
  spi: mtk-snfi: Convert to platform remove callback returning void
  spi: mxic: Convert to platform remove callback returning void
  spi: mxs: Convert to platform remove callback returning void
  spi: npcm-fiu: Convert to platform remove callback returning void
  spi: npcm-pspi: Convert to platform remove callback returning void
  spi: nxp-fspi: Convert to platform remove callback returning void
  spi: oc-tiny: Convert to platform remove callback returning void
  spi: omap-uwire: Convert to platform remove callback returning void
  spi: omap2-mcspi: Convert to platform remove callback returning void
  spi: orion: Convert to platform remove callback returning void
  spi: pic32-sqi: Convert to platform remove callback returning void
  spi: pic32: Convert to platform remove callback returning void
  spi: ppc4xx: Convert to platform remove callback returning void
  spi: pxa2xx: Convert to platform remove callback returning void
  spi: qcom-qspi: Convert to platform remove callback returning void
  spi: rb4xx: Convert to platform remove callback returning void
  spi: rockchip-sfc: Convert to platform remove callback returning void
  spi: rockchip: Convert to platform remove callback returning void
  spi: rpc-if: Convert to platform remove callback returning void
  spi: rspi: Convert to platform remove callback returning void
  spi: s3c64xx: Convert to platform remove callback returning void
  spi: sh-hspi: Convert to platform remove callback returning void
  spi: sh-msiof: Convert to platform remove callback returning void
  spi: sh-sci: Convert to platform remove callback returning void
  spi: sh: Convert to platform remove callback returning void
  spi: sifive: Convert to platform remove callback returning void
  spi: slave-mt27xx: Convert to platform remove callback returning void
  spi: sn-f-ospi: Convert to platform remove callback returning void
  spi: sprd-adi: Convert to platform remove callback returning void
  spi: st-ssc4: Convert to platform remove callback returning void
  spi: stm32-qspi: Convert to platform remove callback returning void
  spi: stm32: Convert to platform remove callback returning void
  spi: sun4i: Convert to platform remove callback returning void
  spi: sun6i: Convert to platform remove callback returning void
  spi: sunplus-sp7021: Convert to platform remove callback returning void
  spi: synquacer: Convert to platform remove callback returning void
  spi: tegra114: Convert to platform remove callback returning void
  spi: tegra20-sflash: Convert to platform remove callback returning void
  spi: tegra20-slink: Convert to platform remove callback returning void
  spi: tegra210-quad: Convert to platform remove callback returning void
  spi: topcliff-pch: Convert to platform remove callback returning void
  spi: uniphier: Convert to platform remove callback returning void
  spi: xilinx: Convert to platform remove callback returning void
  spi: xtensa-xtfpga: Convert to platform remove callback returning void
  spi: zynq-qspi: Convert to platform remove callback returning void
  spi: zynqmp-gqspi: Convert to platform remove callback returning void

 drivers/spi/spi-ar934x.c              |  6 ++----
 drivers/spi/spi-armada-3700.c         |  6 ++----
 drivers/spi/spi-aspeed-smc.c          |  5 ++---
 drivers/spi/spi-at91-usart.c          |  6 ++----
 drivers/spi/spi-ath79.c               |  6 ++----
 drivers/spi/spi-atmel.c               |  6 ++----
 drivers/spi/spi-au1550.c              |  5 ++---
 drivers/spi/spi-axi-spi-engine.c      |  6 ++----
 drivers/spi/spi-bcm2835.c             | 12 +++---------
 drivers/spi/spi-bcm2835aux.c          |  6 ++----
 drivers/spi/spi-bcm63xx-hsspi.c       |  6 ++----
 drivers/spi/spi-bcm63xx.c             |  6 ++----
 drivers/spi/spi-bcmbca-hsspi.c        |  6 ++----
 drivers/spi/spi-brcmstb-qspi.c        |  6 ++----
 drivers/spi/spi-cadence-quadspi.c     |  6 ++----
 drivers/spi/spi-cadence.c             |  6 ++----
 drivers/spi/spi-cavium-octeon.c       |  6 ++----
 drivers/spi/spi-coldfire-qspi.c       |  6 ++----
 drivers/spi/spi-davinci.c             |  5 ++---
 drivers/spi/spi-dln2.c                |  6 ++----
 drivers/spi/spi-dw-bt1.c              |  6 ++----
 drivers/spi/spi-dw-mmio.c             |  6 ++----
 drivers/spi/spi-ep93xx.c              |  6 ++----
 drivers/spi/spi-fsl-dspi.c            |  6 ++----
 drivers/spi/spi-fsl-espi.c            |  6 ++----
 drivers/spi/spi-fsl-lpspi.c           |  5 ++---
 drivers/spi/spi-fsl-qspi.c            |  6 ++----
 drivers/spi/spi-fsl-spi.c             | 11 ++++-------
 drivers/spi/spi-geni-qcom.c           |  5 ++---
 drivers/spi/spi-hisi-kunpeng.c        |  6 ++----
 drivers/spi/spi-img-spfi.c            |  6 ++----
 drivers/spi/spi-iproc-qspi.c          |  6 ++----
 drivers/spi/spi-lantiq-ssc.c          |  6 ++----
 drivers/spi/spi-meson-spicc.c         |  6 ++----
 drivers/spi/spi-meson-spifc.c         |  6 ++----
 drivers/spi/spi-microchip-core-qspi.c |  6 ++----
 drivers/spi/spi-microchip-core.c      |  6 ++----
 drivers/spi/spi-mpc512x-psc.c         | 22 ++++++++--------------
 drivers/spi/spi-mpc52xx-psc.c         |  6 ++----
 drivers/spi/spi-mpc52xx.c             |  6 ++----
 drivers/spi/spi-mtk-nor.c             |  6 ++----
 drivers/spi/spi-mtk-snfi.c            |  5 ++---
 drivers/spi/spi-mxic.c                |  6 ++----
 drivers/spi/spi-mxs.c                 |  6 ++----
 drivers/spi/spi-npcm-fiu.c            |  5 ++---
 drivers/spi/spi-npcm-pspi.c           |  6 ++----
 drivers/spi/spi-nxp-fspi.c            |  6 ++----
 drivers/spi/spi-oc-tiny.c             |  5 ++---
 drivers/spi/spi-omap-uwire.c          |  5 ++---
 drivers/spi/spi-omap2-mcspi.c         |  6 ++----
 drivers/spi/spi-orion.c               |  6 ++----
 drivers/spi/spi-pic32-sqi.c           |  6 ++----
 drivers/spi/spi-pic32.c               |  6 ++----
 drivers/spi/spi-ppc4xx.c              |  5 ++---
 drivers/spi/spi-pxa2xx.c              |  6 ++----
 drivers/spi/spi-qcom-qspi.c           |  6 ++----
 drivers/spi/spi-rb4xx.c               |  6 ++----
 drivers/spi/spi-rockchip-sfc.c        |  6 ++----
 drivers/spi/spi-rockchip.c            |  6 ++----
 drivers/spi/spi-rpc-if.c              |  6 ++----
 drivers/spi/spi-rspi.c                |  6 ++----
 drivers/spi/spi-s3c64xx.c             |  6 ++----
 drivers/spi/spi-sh-hspi.c             |  6 ++----
 drivers/spi/spi-sh-msiof.c            |  5 ++---
 drivers/spi/spi-sh-sci.c              |  5 ++---
 drivers/spi/spi-sh.c                  |  6 ++----
 drivers/spi/spi-sifive.c              |  6 ++----
 drivers/spi/spi-slave-mt27xx.c        |  6 ++----
 drivers/spi/spi-sn-f-ospi.c           |  6 ++----
 drivers/spi/spi-sprd-adi.c            |  5 ++---
 drivers/spi/spi-st-ssc4.c             |  6 ++----
 drivers/spi/spi-stm32-qspi.c          |  6 ++----
 drivers/spi/spi-stm32.c               |  6 ++----
 drivers/spi/spi-sun4i.c               |  6 ++----
 drivers/spi/spi-sun6i.c               |  5 ++---
 drivers/spi/spi-sunplus-sp7021.c      |  5 ++---
 drivers/spi/spi-synquacer.c           |  6 ++----
 drivers/spi/spi-tegra114.c            |  6 ++----
 drivers/spi/spi-tegra20-sflash.c      |  6 ++----
 drivers/spi/spi-tegra20-slink.c       |  5 ++---
 drivers/spi/spi-tegra210-quad.c       |  6 ++----
 drivers/spi/spi-topcliff-pch.c        |  6 ++----
 drivers/spi/spi-uniphier.c            |  6 ++----
 drivers/spi/spi-xilinx.c              |  6 ++----
 drivers/spi/spi-xtensa-xtfpga.c       |  6 ++----
 drivers/spi/spi-zynq-qspi.c           |  6 ++----
 drivers/spi/spi-zynqmp-gqspi.c        |  6 ++----
 87 files changed, 183 insertions(+), 350 deletions(-)

base-commit: 2eb29d59ddf02e39774abfb60b2030b0b7e27c1f
-- 
2.39.1


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

* [PATCH 01/87] spi: ar934x: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 02/87] spi: armada-3700: " Uwe Kleine-König
                   ` (88 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-ar934x.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-ar934x.c b/drivers/spi/spi-ar934x.c
index 4a6ecaa0a9c9..c71c8348eeaa 100644
--- a/drivers/spi/spi-ar934x.c
+++ b/drivers/spi/spi-ar934x.c
@@ -220,7 +220,7 @@ static int ar934x_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int ar934x_spi_remove(struct platform_device *pdev)
+static void ar934x_spi_remove(struct platform_device *pdev)
 {
 	struct spi_controller *ctlr;
 	struct ar934x_spi *sp;
@@ -230,8 +230,6 @@ static int ar934x_spi_remove(struct platform_device *pdev)
 
 	spi_unregister_controller(ctlr);
 	clk_disable_unprepare(sp->clk);
-
-	return 0;
 }
 
 static struct platform_driver ar934x_spi_driver = {
@@ -240,7 +238,7 @@ static struct platform_driver ar934x_spi_driver = {
 		.of_match_table = ar934x_spi_match,
 	},
 	.probe = ar934x_spi_probe,
-	.remove = ar934x_spi_remove,
+	.remove_new = ar934x_spi_remove,
 };
 
 module_platform_driver(ar934x_spi_driver);
-- 
2.39.1


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

* [PATCH 02/87] spi: armada-3700: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 01/87] spi: ar934x: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 03/87] spi: aspeed-smc: " Uwe Kleine-König
                   ` (87 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-armada-3700.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c
index 4d554b948d71..6a7e605f73bf 100644
--- a/drivers/spi/spi-armada-3700.c
+++ b/drivers/spi/spi-armada-3700.c
@@ -908,14 +908,12 @@ static int a3700_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int a3700_spi_remove(struct platform_device *pdev)
+static void a3700_spi_remove(struct platform_device *pdev)
 {
 	struct spi_controller *host = platform_get_drvdata(pdev);
 	struct a3700_spi *spi = spi_controller_get_devdata(host);
 
 	clk_unprepare(spi->clk);
-
-	return 0;
 }
 
 static struct platform_driver a3700_spi_driver = {
@@ -924,7 +922,7 @@ static struct platform_driver a3700_spi_driver = {
 		.of_match_table = of_match_ptr(a3700_spi_dt_ids),
 	},
 	.probe		= a3700_spi_probe,
-	.remove		= a3700_spi_remove,
+	.remove_new	= a3700_spi_remove,
 };
 
 module_platform_driver(a3700_spi_driver);
-- 
2.39.1


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

* [PATCH 03/87] spi: aspeed-smc: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 01/87] spi: ar934x: " Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 02/87] spi: armada-3700: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 21:52   ` Cédric Le Goater
  2023-03-03 17:19 ` [PATCH 04/87] spi: at91-usart: " Uwe Kleine-König
                   ` (86 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Chin-Ting Kuo, Cédric Le Goater, Mark Brown, Joel Stanley
  Cc: Andrew Jeffery, linux-aspeed, openbmc, linux-spi,
	linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-aspeed-smc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c
index 873ff2cf72c9..3f2548860317 100644
--- a/drivers/spi/spi-aspeed-smc.c
+++ b/drivers/spi/spi-aspeed-smc.c
@@ -787,13 +787,12 @@ static int aspeed_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int aspeed_spi_remove(struct platform_device *pdev)
+static void aspeed_spi_remove(struct platform_device *pdev)
 {
 	struct aspeed_spi *aspi = platform_get_drvdata(pdev);
 
 	aspeed_spi_enable(aspi, false);
 	clk_disable_unprepare(aspi->clk);
-	return 0;
 }
 
 /*
@@ -1201,7 +1200,7 @@ MODULE_DEVICE_TABLE(of, aspeed_spi_matches);
 
 static struct platform_driver aspeed_spi_driver = {
 	.probe			= aspeed_spi_probe,
-	.remove			= aspeed_spi_remove,
+	.remove_new		= aspeed_spi_remove,
 	.driver	= {
 		.name		= DEVICE_NAME,
 		.of_match_table = aspeed_spi_matches,
-- 
2.39.1


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

* [PATCH 04/87] spi: at91-usart: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 03/87] spi: aspeed-smc: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-06 11:57   ` Claudiu.Beznea
  2023-03-03 17:19 ` [PATCH 05/87] spi: ath79: " Uwe Kleine-König
                   ` (85 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Radu Pirea, Mark Brown, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea
  Cc: linux-spi, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-at91-usart.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
index fab9d223e24a..4fb3653b5941 100644
--- a/drivers/spi/spi-at91-usart.c
+++ b/drivers/spi/spi-at91-usart.c
@@ -647,15 +647,13 @@ __maybe_unused static int at91_usart_spi_resume(struct device *dev)
 	return spi_controller_resume(ctrl);
 }
 
-static int at91_usart_spi_remove(struct platform_device *pdev)
+static void at91_usart_spi_remove(struct platform_device *pdev)
 {
 	struct spi_controller *ctlr = platform_get_drvdata(pdev);
 	struct at91_usart_spi *aus = spi_controller_get_devdata(ctlr);
 
 	at91_usart_spi_release_dma(ctlr);
 	clk_disable_unprepare(aus->clk);
-
-	return 0;
 }
 
 static const struct dev_pm_ops at91_usart_spi_pm_ops = {
@@ -670,7 +668,7 @@ static struct platform_driver at91_usart_spi_driver = {
 		.pm = &at91_usart_spi_pm_ops,
 	},
 	.probe = at91_usart_spi_probe,
-	.remove = at91_usart_spi_remove,
+	.remove_new = at91_usart_spi_remove,
 };
 
 module_platform_driver(at91_usart_spi_driver);
-- 
2.39.1


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

* [PATCH 05/87] spi: ath79: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 04/87] spi: at91-usart: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 06/87] spi: atmel: " Uwe Kleine-König
                   ` (84 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-ath79.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c
index 795e88dbef1b..b4d25b3bee19 100644
--- a/drivers/spi/spi-ath79.c
+++ b/drivers/spi/spi-ath79.c
@@ -237,7 +237,7 @@ static int ath79_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int ath79_spi_remove(struct platform_device *pdev)
+static void ath79_spi_remove(struct platform_device *pdev)
 {
 	struct ath79_spi *sp = platform_get_drvdata(pdev);
 
@@ -245,8 +245,6 @@ static int ath79_spi_remove(struct platform_device *pdev)
 	ath79_spi_disable(sp);
 	clk_disable_unprepare(sp->clk);
 	spi_controller_put(sp->bitbang.master);
-
-	return 0;
 }
 
 static void ath79_spi_shutdown(struct platform_device *pdev)
@@ -262,7 +260,7 @@ MODULE_DEVICE_TABLE(of, ath79_spi_of_match);
 
 static struct platform_driver ath79_spi_driver = {
 	.probe		= ath79_spi_probe,
-	.remove		= ath79_spi_remove,
+	.remove_new	= ath79_spi_remove,
 	.shutdown	= ath79_spi_shutdown,
 	.driver		= {
 		.name	= DRV_NAME,
-- 
2.39.1


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

* [PATCH 06/87] spi: atmel: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 05/87] spi: ath79: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-06 11:57   ` Claudiu.Beznea
  2023-03-03 17:19 ` [PATCH 07/87] spi: au1550: " Uwe Kleine-König
                   ` (83 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea
  Cc: linux-spi, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-atmel.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 5c5678f065f3..73f80c8ac2ff 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1596,7 +1596,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int atmel_spi_remove(struct platform_device *pdev)
+static void atmel_spi_remove(struct platform_device *pdev)
 {
 	struct spi_controller	*host = platform_get_drvdata(pdev);
 	struct atmel_spi	*as = spi_controller_get_devdata(host);
@@ -1627,8 +1627,6 @@ static int atmel_spi_remove(struct platform_device *pdev)
 
 	pm_runtime_put_noidle(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static int atmel_spi_runtime_suspend(struct device *dev)
@@ -1712,7 +1710,7 @@ static struct platform_driver atmel_spi_driver = {
 		.of_match_table	= atmel_spi_dt_ids,
 	},
 	.probe		= atmel_spi_probe,
-	.remove		= atmel_spi_remove,
+	.remove_new	= atmel_spi_remove,
 };
 module_platform_driver(atmel_spi_driver);
 
-- 
2.39.1


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

* [PATCH 07/87] spi: au1550: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 06/87] spi: atmel: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 08/87] spi: axi-spi-engine: " Uwe Kleine-König
                   ` (82 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-au1550.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-au1550.c b/drivers/spi/spi-au1550.c
index e008761298da..8151bed8a117 100644
--- a/drivers/spi/spi-au1550.c
+++ b/drivers/spi/spi-au1550.c
@@ -923,7 +923,7 @@ static int au1550_spi_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int au1550_spi_remove(struct platform_device *pdev)
+static void au1550_spi_remove(struct platform_device *pdev)
 {
 	struct au1550_spi *hw = platform_get_drvdata(pdev);
 
@@ -942,7 +942,6 @@ static int au1550_spi_remove(struct platform_device *pdev)
 	}
 
 	spi_master_put(hw->master);
-	return 0;
 }
 
 /* work with hotplug and coldplug */
@@ -950,7 +949,7 @@ MODULE_ALIAS("platform:au1550-spi");
 
 static struct platform_driver au1550_spi_drv = {
 	.probe = au1550_spi_probe,
-	.remove = au1550_spi_remove,
+	.remove_new = au1550_spi_remove,
 	.driver = {
 		.name = "au1550-spi",
 	},
-- 
2.39.1


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

* [PATCH 08/87] spi: axi-spi-engine: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (6 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 07/87] spi: au1550: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 09/87] spi: bcm2835: " Uwe Kleine-König
                   ` (81 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-axi-spi-engine.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index 80c3e38f5c1b..c5a3a3189164 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -554,7 +554,7 @@ static int spi_engine_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int spi_engine_remove(struct platform_device *pdev)
+static void spi_engine_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
 	struct spi_engine *spi_engine = spi_master_get_devdata(master);
@@ -572,8 +572,6 @@ static int spi_engine_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(spi_engine->ref_clk);
 	clk_disable_unprepare(spi_engine->clk);
-
-	return 0;
 }
 
 static const struct of_device_id spi_engine_match_table[] = {
@@ -584,7 +582,7 @@ MODULE_DEVICE_TABLE(of, spi_engine_match_table);
 
 static struct platform_driver spi_engine_driver = {
 	.probe = spi_engine_probe,
-	.remove = spi_engine_remove,
+	.remove_new = spi_engine_remove,
 	.driver = {
 		.name = "spi-engine",
 		.of_match_table = spi_engine_match_table,
-- 
2.39.1


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

* [PATCH 09/87] spi: bcm2835: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (7 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 08/87] spi: axi-spi-engine: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:23   ` Florian Fainelli
  2023-03-06  7:04   ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 10/87] spi: bcm2835aux: " Uwe Kleine-König
                   ` (80 subsequent siblings)
  89 siblings, 2 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown, Florian Fainelli, Ray Jui, Scott Branden
  Cc: Broadcom internal kernel review list, linux-spi,
	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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-bcm2835.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 747e03228c48..be6050b513a9 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -1398,7 +1398,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int bcm2835_spi_remove(struct platform_device *pdev)
+static void bcm2835_spi_remove(struct platform_device *pdev)
 {
 	struct spi_controller *ctlr = platform_get_drvdata(pdev);
 	struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr);
@@ -1414,17 +1414,11 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
 		   BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
 
 	clk_disable_unprepare(bs->clk);
-
-	return 0;
 }
 
 static void bcm2835_spi_shutdown(struct platform_device *pdev)
 {
-	int ret;
-
-	ret = bcm2835_spi_remove(pdev);
-	if (ret)
-		dev_err(&pdev->dev, "failed to shutdown\n");
+	rbcm2835_spi_remove(pdev);
 }
 
 static const struct of_device_id bcm2835_spi_match[] = {
@@ -1439,7 +1433,7 @@ static struct platform_driver bcm2835_spi_driver = {
 		.of_match_table	= bcm2835_spi_match,
 	},
 	.probe		= bcm2835_spi_probe,
-	.remove		= bcm2835_spi_remove,
+	.remove_new	= bcm2835_spi_remove,
 	.shutdown	= bcm2835_spi_shutdown,
 };
 module_platform_driver(bcm2835_spi_driver);
-- 
2.39.1


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

* [PATCH 10/87] spi: bcm2835aux: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (8 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 09/87] spi: bcm2835: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:23   ` Florian Fainelli
  2023-03-03 17:19 ` [PATCH 11/87] spi: bcm63xx-hsspi: " Uwe Kleine-König
                   ` (79 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown, Florian Fainelli, Ray Jui, Scott Branden
  Cc: Broadcom internal kernel review list, linux-spi,
	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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-bcm2835aux.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c
index e28521922330..7f2546fd900a 100644
--- a/drivers/spi/spi-bcm2835aux.c
+++ b/drivers/spi/spi-bcm2835aux.c
@@ -567,7 +567,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int bcm2835aux_spi_remove(struct platform_device *pdev)
+static void bcm2835aux_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
@@ -580,8 +580,6 @@ static int bcm2835aux_spi_remove(struct platform_device *pdev)
 
 	/* disable the HW block by releasing the clock */
 	clk_disable_unprepare(bs->clk);
-
-	return 0;
 }
 
 static const struct of_device_id bcm2835aux_spi_match[] = {
@@ -596,7 +594,7 @@ static struct platform_driver bcm2835aux_spi_driver = {
 		.of_match_table	= bcm2835aux_spi_match,
 	},
 	.probe		= bcm2835aux_spi_probe,
-	.remove		= bcm2835aux_spi_remove,
+	.remove_new	= bcm2835aux_spi_remove,
 };
 module_platform_driver(bcm2835aux_spi_driver);
 
-- 
2.39.1


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

* [PATCH 11/87] spi: bcm63xx-hsspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (9 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 10/87] spi: bcm2835aux: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:26   ` Florian Fainelli
  2023-03-03 17:19 ` [PATCH 12/87] spi: bcm63xx: " Uwe Kleine-König
                   ` (78 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: William Zhang, Kursad Oney, Jonas Gorski, Mark Brown
  Cc: Broadcom internal kernel review list, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-bcm63xx-hsspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
index cd0a6478f5e7..f2708caa2f33 100644
--- a/drivers/spi/spi-bcm63xx-hsspi.c
+++ b/drivers/spi/spi-bcm63xx-hsspi.c
@@ -878,7 +878,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
 }
 
 
-static int bcm63xx_hsspi_remove(struct platform_device *pdev)
+static void bcm63xx_hsspi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct bcm63xx_hsspi *bs = spi_master_get_devdata(master);
@@ -888,8 +888,6 @@ static int bcm63xx_hsspi_remove(struct platform_device *pdev)
 	clk_disable_unprepare(bs->pll_clk);
 	clk_disable_unprepare(bs->clk);
 	sysfs_remove_group(&pdev->dev.kobj, &bcm63xx_hsspi_group);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -946,7 +944,7 @@ static struct platform_driver bcm63xx_hsspi_driver = {
 		.of_match_table = bcm63xx_hsspi_of_match,
 	},
 	.probe		= bcm63xx_hsspi_probe,
-	.remove		= bcm63xx_hsspi_remove,
+	.remove_new	= bcm63xx_hsspi_remove,
 };
 
 module_platform_driver(bcm63xx_hsspi_driver);
-- 
2.39.1


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

* [PATCH 12/87] spi: bcm63xx: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (10 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 11/87] spi: bcm63xx-hsspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 13/87] spi: bcmbca-hsspi: " Uwe Kleine-König
                   ` (77 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-bcm63xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index 3686d78c44a6..0a78351bfd24 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -615,7 +615,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int bcm63xx_spi_remove(struct platform_device *pdev)
+static void bcm63xx_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct bcm63xx_spi *bs = spi_master_get_devdata(master);
@@ -625,8 +625,6 @@ static int bcm63xx_spi_remove(struct platform_device *pdev)
 
 	/* HW shutdown */
 	clk_disable_unprepare(bs->clk);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -670,7 +668,7 @@ static struct platform_driver bcm63xx_spi_driver = {
 	},
 	.id_table	= bcm63xx_spi_dev_match,
 	.probe		= bcm63xx_spi_probe,
-	.remove		= bcm63xx_spi_remove,
+	.remove_new	= bcm63xx_spi_remove,
 };
 
 module_platform_driver(bcm63xx_spi_driver);
-- 
2.39.1


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

* [PATCH 13/87] spi: bcmbca-hsspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (11 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 12/87] spi: bcm63xx: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:24   ` Florian Fainelli
  2023-03-03 17:19 ` [PATCH 14/87] spi: brcmstb-qspi: " Uwe Kleine-König
                   ` (76 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: William Zhang, Kursad Oney, Jonas Gorski, Mark Brown, Anand Gore,
	Florian Fainelli, Rafał Miłecki
  Cc: Broadcom internal kernel review list, linux-spi,
	linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-bcmbca-hsspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcmbca-hsspi.c b/drivers/spi/spi-bcmbca-hsspi.c
index 3f9e6131ad86..c7a44832bc9c 100644
--- a/drivers/spi/spi-bcmbca-hsspi.c
+++ b/drivers/spi/spi-bcmbca-hsspi.c
@@ -576,7 +576,7 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int bcmbca_hsspi_remove(struct platform_device *pdev)
+static void bcmbca_hsspi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct bcmbca_hsspi *bs = spi_master_get_devdata(master);
@@ -586,8 +586,6 @@ static int bcmbca_hsspi_remove(struct platform_device *pdev)
 	clk_disable_unprepare(bs->pll_clk);
 	clk_disable_unprepare(bs->clk);
 	sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -644,7 +642,7 @@ static struct platform_driver bcmbca_hsspi_driver = {
 		   .of_match_table = bcmbca_hsspi_of_match,
 		   },
 	.probe = bcmbca_hsspi_probe,
-	.remove = bcmbca_hsspi_remove,
+	.remove_new = bcmbca_hsspi_remove,
 };
 
 module_platform_driver(bcmbca_hsspi_driver);
-- 
2.39.1


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

* [PATCH 14/87] spi: brcmstb-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (12 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 13/87] spi: bcmbca-hsspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:24   ` Florian Fainelli
  2023-03-03 17:19 ` [PATCH 15/87] spi: cadence-quadspi: " Uwe Kleine-König
                   ` (75 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Kamal Dasu, Mark Brown, Florian Fainelli
  Cc: Broadcom internal kernel review list, linux-spi,
	linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-brcmstb-qspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-brcmstb-qspi.c b/drivers/spi/spi-brcmstb-qspi.c
index de362b35718f..e1b137419f5c 100644
--- a/drivers/spi/spi-brcmstb-qspi.c
+++ b/drivers/spi/spi-brcmstb-qspi.c
@@ -21,16 +21,14 @@ static int brcmstb_qspi_probe(struct platform_device *pdev)
 	return bcm_qspi_probe(pdev, NULL);
 }
 
-static int brcmstb_qspi_remove(struct platform_device *pdev)
+static void brcmstb_qspi_remove(struct platform_device *pdev)
 {
 	bcm_qspi_remove(pdev);
-
-	return 0;
 }
 
 static struct platform_driver brcmstb_qspi_driver = {
 	.probe			= brcmstb_qspi_probe,
-	.remove			= brcmstb_qspi_remove,
+	.remove_new		= brcmstb_qspi_remove,
 	.driver = {
 		.name		= "brcmstb_qspi",
 		.pm		= &bcm_qspi_pm_ops,
-- 
2.39.1


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

* [PATCH 15/87] spi: cadence-quadspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (13 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 14/87] spi: brcmstb-qspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 16/87] spi: cadence: " Uwe Kleine-König
                   ` (74 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-cadence-quadspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 64b6a460d739..c58c36fc2b36 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1784,7 +1784,7 @@ static int cqspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int cqspi_remove(struct platform_device *pdev)
+static void cqspi_remove(struct platform_device *pdev)
 {
 	struct cqspi_st *cqspi = platform_get_drvdata(pdev);
 
@@ -1798,8 +1798,6 @@ static int cqspi_remove(struct platform_device *pdev)
 
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -1891,7 +1889,7 @@ MODULE_DEVICE_TABLE(of, cqspi_dt_ids);
 
 static struct platform_driver cqspi_platform_driver = {
 	.probe = cqspi_probe,
-	.remove = cqspi_remove,
+	.remove_new = cqspi_remove,
 	.driver = {
 		.name = CQSPI_NAME,
 		.pm = CQSPI_DEV_PM_OPS,
-- 
2.39.1


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

* [PATCH 16/87] spi: cadence: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (14 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 15/87] spi: cadence-quadspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 17/87] spi: cavium-octeon: " Uwe Kleine-König
                   ` (73 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-cadence.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c
index 6a7f7df1e776..1ad86e5d2b2f 100644
--- a/drivers/spi/spi-cadence.c
+++ b/drivers/spi/spi-cadence.c
@@ -625,7 +625,7 @@ static int cdns_spi_probe(struct platform_device *pdev)
  *
  * Return:	0 on success and error value on error
  */
-static int cdns_spi_remove(struct platform_device *pdev)
+static void cdns_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct cdns_spi *xspi = spi_master_get_devdata(master);
@@ -638,8 +638,6 @@ static int cdns_spi_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 
 	spi_unregister_master(master);
-
-	return 0;
 }
 
 /**
@@ -739,7 +737,7 @@ MODULE_DEVICE_TABLE(of, cdns_spi_of_match);
 /* cdns_spi_driver - This structure defines the SPI subsystem platform driver */
 static struct platform_driver cdns_spi_driver = {
 	.probe	= cdns_spi_probe,
-	.remove	= cdns_spi_remove,
+	.remove_new = cdns_spi_remove,
 	.driver = {
 		.name = CDNS_SPI_NAME,
 		.of_match_table = cdns_spi_of_match,
-- 
2.39.1


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

* [PATCH 17/87] spi: cavium-octeon: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (15 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 16/87] spi: cadence: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 18/87] spi: coldfire-qspi: " Uwe Kleine-König
                   ` (72 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-cavium-octeon.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-cavium-octeon.c b/drivers/spi/spi-cavium-octeon.c
index 1a2de6ce9064..58060be33106 100644
--- a/drivers/spi/spi-cavium-octeon.c
+++ b/drivers/spi/spi-cavium-octeon.c
@@ -69,15 +69,13 @@ static int octeon_spi_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int octeon_spi_remove(struct platform_device *pdev)
+static void octeon_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct octeon_spi *p = spi_master_get_devdata(master);
 
 	/* Clear the CSENA* and put everything in a known state. */
 	writeq(0, p->register_base + OCTEON_SPI_CFG(p));
-
-	return 0;
 }
 
 static const struct of_device_id octeon_spi_match[] = {
@@ -92,7 +90,7 @@ static struct platform_driver octeon_spi_driver = {
 		.of_match_table = octeon_spi_match,
 	},
 	.probe		= octeon_spi_probe,
-	.remove		= octeon_spi_remove,
+	.remove_new	= octeon_spi_remove,
 };
 
 module_platform_driver(octeon_spi_driver);
-- 
2.39.1


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

* [PATCH 18/87] spi: coldfire-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (16 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 17/87] spi: cavium-octeon: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 19/87] spi: davinci: " Uwe Kleine-König
                   ` (71 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-coldfire-qspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index 263ce9047327..d98e74c6e4b2 100644
--- a/drivers/spi/spi-coldfire-qspi.c
+++ b/drivers/spi/spi-coldfire-qspi.c
@@ -434,7 +434,7 @@ static int mcfqspi_probe(struct platform_device *pdev)
 	return status;
 }
 
-static int mcfqspi_remove(struct platform_device *pdev)
+static void mcfqspi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
@@ -445,8 +445,6 @@ static int mcfqspi_remove(struct platform_device *pdev)
 
 	mcfqspi_cs_teardown(mcfqspi);
 	clk_disable_unprepare(mcfqspi->clk);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -509,7 +507,7 @@ static struct platform_driver mcfqspi_driver = {
 	.driver.owner	= THIS_MODULE,
 	.driver.pm	= &mcfqspi_pm,
 	.probe		= mcfqspi_probe,
-	.remove		= mcfqspi_remove,
+	.remove_new	= mcfqspi_remove,
 };
 module_platform_driver(mcfqspi_driver);
 
-- 
2.39.1


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

* [PATCH 19/87] spi: davinci: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (17 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 18/87] spi: coldfire-qspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 20/87] spi: dln2: " Uwe Kleine-König
                   ` (70 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-davinci.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index d112c2cac042..add1e198a439 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -1018,7 +1018,7 @@ static int davinci_spi_probe(struct platform_device *pdev)
  * It will also call spi_bitbang_stop to destroy the work queue which was
  * created by spi_bitbang_start.
  */
-static int davinci_spi_remove(struct platform_device *pdev)
+static void davinci_spi_remove(struct platform_device *pdev)
 {
 	struct davinci_spi *dspi;
 	struct spi_master *master;
@@ -1036,7 +1036,6 @@ static int davinci_spi_remove(struct platform_device *pdev)
 	}
 
 	spi_master_put(master);
-	return 0;
 }
 
 static struct platform_driver davinci_spi_driver = {
@@ -1045,7 +1044,7 @@ static struct platform_driver davinci_spi_driver = {
 		.of_match_table = of_match_ptr(davinci_spi_of_match),
 	},
 	.probe = davinci_spi_probe,
-	.remove = davinci_spi_remove,
+	.remove_new = davinci_spi_remove,
 };
 module_platform_driver(davinci_spi_driver);
 
-- 
2.39.1


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

* [PATCH 20/87] spi: dln2: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (18 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 19/87] spi: davinci: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 21/87] spi: dw-bt1: " Uwe Kleine-König
                   ` (69 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-dln2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-dln2.c b/drivers/spi/spi-dln2.c
index 0a1fb2bc9e54..821bfc6b0dd6 100644
--- a/drivers/spi/spi-dln2.c
+++ b/drivers/spi/spi-dln2.c
@@ -781,7 +781,7 @@ static int dln2_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int dln2_spi_remove(struct platform_device *pdev)
+static void dln2_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct dln2_spi *dln2 = spi_master_get_devdata(master);
@@ -790,8 +790,6 @@ static int dln2_spi_remove(struct platform_device *pdev)
 
 	if (dln2_spi_enable(dln2, false) < 0)
 		dev_err(&pdev->dev, "Failed to disable SPI module\n");
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -873,7 +871,7 @@ static struct platform_driver spi_dln2_driver = {
 		.pm	= &dln2_spi_pm,
 	},
 	.probe		= dln2_spi_probe,
-	.remove		= dln2_spi_remove,
+	.remove_new	= dln2_spi_remove,
 };
 module_platform_driver(spi_dln2_driver);
 
-- 
2.39.1


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

* [PATCH 21/87] spi: dw-bt1: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (19 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 20/87] spi: dln2: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-06 15:22   ` Serge Semin
  2023-03-03 17:19 ` [PATCH 22/87] spi: dw-mmio: " Uwe Kleine-König
                   ` (68 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Serge Semin, Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-dw-bt1.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-dw-bt1.c b/drivers/spi/spi-dw-bt1.c
index 3fb89dee595e..5e1c01822967 100644
--- a/drivers/spi/spi-dw-bt1.c
+++ b/drivers/spi/spi-dw-bt1.c
@@ -308,7 +308,7 @@ static int dw_spi_bt1_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int dw_spi_bt1_remove(struct platform_device *pdev)
+static void dw_spi_bt1_remove(struct platform_device *pdev)
 {
 	struct dw_spi_bt1 *dwsbt1 = platform_get_drvdata(pdev);
 
@@ -317,8 +317,6 @@ static int dw_spi_bt1_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 
 	clk_disable_unprepare(dwsbt1->clk);
-
-	return 0;
 }
 
 static const struct of_device_id dw_spi_bt1_of_match[] = {
@@ -330,7 +328,7 @@ MODULE_DEVICE_TABLE(of, dw_spi_bt1_of_match);
 
 static struct platform_driver dw_spi_bt1_driver = {
 	.probe	= dw_spi_bt1_probe,
-	.remove	= dw_spi_bt1_remove,
+	.remove_new = dw_spi_bt1_remove,
 	.driver	= {
 		.name		= "bt1-sys-ssi",
 		.of_match_table	= dw_spi_bt1_of_match,
-- 
2.39.1


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

* [PATCH 22/87] spi: dw-mmio: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (20 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 21/87] spi: dw-bt1: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-06 15:22   ` Serge Semin
  2023-03-03 17:19 ` [PATCH 23/87] spi: ep93xx: " Uwe Kleine-König
                   ` (67 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Serge Semin, Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-dw-mmio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
index 26c40ea6dd12..6ae124c30969 100644
--- a/drivers/spi/spi-dw-mmio.c
+++ b/drivers/spi/spi-dw-mmio.c
@@ -328,7 +328,7 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int dw_spi_mmio_remove(struct platform_device *pdev)
+static void dw_spi_mmio_remove(struct platform_device *pdev)
 {
 	struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev);
 
@@ -337,8 +337,6 @@ static int dw_spi_mmio_remove(struct platform_device *pdev)
 	clk_disable_unprepare(dwsmmio->pclk);
 	clk_disable_unprepare(dwsmmio->clk);
 	reset_control_assert(dwsmmio->rstc);
-
-	return 0;
 }
 
 static const struct of_device_id dw_spi_mmio_of_match[] = {
@@ -366,7 +364,7 @@ MODULE_DEVICE_TABLE(acpi, dw_spi_mmio_acpi_match);
 
 static struct platform_driver dw_spi_mmio_driver = {
 	.probe		= dw_spi_mmio_probe,
-	.remove		= dw_spi_mmio_remove,
+	.remove_new	= dw_spi_mmio_remove,
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.of_match_table = dw_spi_mmio_of_match,
-- 
2.39.1


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

* [PATCH 23/87] spi: ep93xx: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (21 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 22/87] spi: dw-mmio: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 24/87] spi: fsl-dspi: " Uwe Kleine-König
                   ` (66 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-ep93xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index 5896a7b2fade..1615fd22f9a2 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -745,14 +745,12 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int ep93xx_spi_remove(struct platform_device *pdev)
+static void ep93xx_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
 
 	ep93xx_spi_release_dma(espi);
-
-	return 0;
 }
 
 static struct platform_driver ep93xx_spi_driver = {
@@ -760,7 +758,7 @@ static struct platform_driver ep93xx_spi_driver = {
 		.name	= "ep93xx-spi",
 	},
 	.probe		= ep93xx_spi_probe,
-	.remove		= ep93xx_spi_remove,
+	.remove_new	= ep93xx_spi_remove,
 };
 module_platform_driver(ep93xx_spi_driver);
 
-- 
2.39.1


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

* [PATCH 24/87] spi: fsl-dspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (22 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 23/87] spi: ep93xx: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 25/87] spi: fsl-espi: " Uwe Kleine-König
                   ` (65 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Vladimir Oltean, Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-fsl-dspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index e419642eb10e..49df00f52ea4 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -1425,7 +1425,7 @@ static int dspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int dspi_remove(struct platform_device *pdev)
+static void dspi_remove(struct platform_device *pdev)
 {
 	struct fsl_dspi *dspi = platform_get_drvdata(pdev);
 
@@ -1444,8 +1444,6 @@ static int dspi_remove(struct platform_device *pdev)
 	if (dspi->irq)
 		free_irq(dspi->irq, dspi);
 	clk_disable_unprepare(dspi->clk);
-
-	return 0;
 }
 
 static void dspi_shutdown(struct platform_device *pdev)
@@ -1459,7 +1457,7 @@ static struct platform_driver fsl_dspi_driver = {
 	.driver.owner		= THIS_MODULE,
 	.driver.pm		= &dspi_pm,
 	.probe			= dspi_probe,
-	.remove			= dspi_remove,
+	.remove_new		= dspi_remove,
 	.shutdown		= dspi_shutdown,
 };
 module_platform_driver(fsl_dspi_driver);
-- 
2.39.1


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

* [PATCH 25/87] spi: fsl-espi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (23 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 24/87] spi: fsl-dspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 26/87] spi: fsl-lpspi: " Uwe Kleine-König
                   ` (64 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-fsl-espi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index f7066bef7b06..42a3ed79e7dc 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -783,11 +783,9 @@ static int of_fsl_espi_probe(struct platform_device *ofdev)
 	return fsl_espi_probe(dev, &mem, irq, num_cs);
 }
 
-static int of_fsl_espi_remove(struct platform_device *dev)
+static void of_fsl_espi_remove(struct platform_device *dev)
 {
 	pm_runtime_disable(&dev->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -837,7 +835,7 @@ static struct platform_driver fsl_espi_driver = {
 		.pm = &espi_pm,
 	},
 	.probe		= of_fsl_espi_probe,
-	.remove		= of_fsl_espi_remove,
+	.remove_new	= of_fsl_espi_remove,
 };
 module_platform_driver(fsl_espi_driver);
 
-- 
2.39.1


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

* [PATCH 26/87] spi: fsl-lpspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (24 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 25/87] spi: fsl-espi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 27/87] spi: fsl-qspi: " Uwe Kleine-König
                   ` (63 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-fsl-lpspi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index 34488de55587..b9e8b7b241a4 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -937,7 +937,7 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int fsl_lpspi_remove(struct platform_device *pdev)
+static void fsl_lpspi_remove(struct platform_device *pdev)
 {
 	struct spi_controller *controller = platform_get_drvdata(pdev);
 	struct fsl_lpspi_data *fsl_lpspi =
@@ -946,7 +946,6 @@ static int fsl_lpspi_remove(struct platform_device *pdev)
 	fsl_lpspi_dma_exit(controller);
 
 	pm_runtime_disable(fsl_lpspi->dev);
-	return 0;
 }
 
 static int __maybe_unused fsl_lpspi_suspend(struct device *dev)
@@ -983,7 +982,7 @@ static struct platform_driver fsl_lpspi_driver = {
 		.pm = &fsl_lpspi_pm_ops,
 	},
 	.probe = fsl_lpspi_probe,
-	.remove = fsl_lpspi_remove,
+	.remove_new = fsl_lpspi_remove,
 };
 module_platform_driver(fsl_lpspi_driver);
 
-- 
2.39.1


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

* [PATCH 27/87] spi: fsl-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (25 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 26/87] spi: fsl-lpspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 28/87] spi: fsl-spi: " Uwe Kleine-König
                   ` (62 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Han Xu, Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-fsl-qspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c
index 85cc71ba624a..bacc54836959 100644
--- a/drivers/spi/spi-fsl-qspi.c
+++ b/drivers/spi/spi-fsl-qspi.c
@@ -948,7 +948,7 @@ static int fsl_qspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int fsl_qspi_remove(struct platform_device *pdev)
+static void fsl_qspi_remove(struct platform_device *pdev)
 {
 	struct fsl_qspi *q = platform_get_drvdata(pdev);
 
@@ -959,8 +959,6 @@ static int fsl_qspi_remove(struct platform_device *pdev)
 	fsl_qspi_clk_disable_unprep(q);
 
 	mutex_destroy(&q->lock);
-
-	return 0;
 }
 
 static int fsl_qspi_suspend(struct device *dev)
@@ -1000,7 +998,7 @@ static struct platform_driver fsl_qspi_driver = {
 		.pm =   &fsl_qspi_pm_ops,
 	},
 	.probe          = fsl_qspi_probe,
-	.remove		= fsl_qspi_remove,
+	.remove_new	= fsl_qspi_remove,
 };
 module_platform_driver(fsl_qspi_driver);
 
-- 
2.39.1


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

* [PATCH 28/87] spi: fsl-spi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (26 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 27/87] spi: fsl-qspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 29/87] spi: geni-qcom: " Uwe Kleine-König
                   ` (61 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-fsl-spi.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 93152144fd2e..725d043488a1 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -716,13 +716,12 @@ static int of_fsl_spi_probe(struct platform_device *ofdev)
 	return ret;
 }
 
-static int of_fsl_spi_remove(struct platform_device *ofdev)
+static void of_fsl_spi_remove(struct platform_device *ofdev)
 {
 	struct spi_master *master = platform_get_drvdata(ofdev);
 	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master);
 
 	fsl_spi_cpm_free(mpc8xxx_spi);
-	return 0;
 }
 
 static struct platform_driver of_fsl_spi_driver = {
@@ -731,7 +730,7 @@ static struct platform_driver of_fsl_spi_driver = {
 		.of_match_table = of_fsl_spi_match,
 	},
 	.probe		= of_fsl_spi_probe,
-	.remove		= of_fsl_spi_remove,
+	.remove_new	= of_fsl_spi_remove,
 };
 
 #ifdef CONFIG_MPC832x_RDB
@@ -763,20 +762,18 @@ static int plat_mpc8xxx_spi_probe(struct platform_device *pdev)
 	return PTR_ERR_OR_ZERO(master);
 }
 
-static int plat_mpc8xxx_spi_remove(struct platform_device *pdev)
+static void plat_mpc8xxx_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master);
 
 	fsl_spi_cpm_free(mpc8xxx_spi);
-
-	return 0;
 }
 
 MODULE_ALIAS("platform:mpc8xxx_spi");
 static struct platform_driver mpc8xxx_spi_driver = {
 	.probe = plat_mpc8xxx_spi_probe,
-	.remove = plat_mpc8xxx_spi_remove,
+	.remove_new = plat_mpc8xxx_spi_remove,
 	.driver = {
 		.name = "mpc8xxx_spi",
 	},
-- 
2.39.1


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

* [PATCH 29/87] spi: geni-qcom: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (27 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 28/87] spi: fsl-spi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 30/87] spi: hisi-kunpeng: " Uwe Kleine-König
                   ` (60 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Mark Brown
  Cc: Konrad Dybcio, linux-arm-msm, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-geni-qcom.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index babb039bcb43..f80635532b4d 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -1114,7 +1114,7 @@ static int spi_geni_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int spi_geni_remove(struct platform_device *pdev)
+static void spi_geni_remove(struct platform_device *pdev)
 {
 	struct spi_master *spi = platform_get_drvdata(pdev);
 	struct spi_geni_master *mas = spi_master_get_devdata(spi);
@@ -1126,7 +1126,6 @@ static int spi_geni_remove(struct platform_device *pdev)
 
 	free_irq(mas->irq, spi);
 	pm_runtime_disable(&pdev->dev);
-	return 0;
 }
 
 static int __maybe_unused spi_geni_runtime_suspend(struct device *dev)
@@ -1208,7 +1207,7 @@ MODULE_DEVICE_TABLE(of, spi_geni_dt_match);
 
 static struct platform_driver spi_geni_driver = {
 	.probe  = spi_geni_probe,
-	.remove = spi_geni_remove,
+	.remove_new = spi_geni_remove,
 	.driver = {
 		.name = "geni_spi",
 		.pm = &spi_geni_pm_ops,
-- 
2.39.1


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

* [PATCH 30/87] spi: hisi-kunpeng: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (28 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 29/87] spi: geni-qcom: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 31/87] spi: img-spfi: " Uwe Kleine-König
                   ` (59 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Jay Fang, Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-hisi-kunpeng.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c
index 525cc0143a30..524eadbef87b 100644
--- a/drivers/spi/spi-hisi-kunpeng.c
+++ b/drivers/spi/spi-hisi-kunpeng.c
@@ -523,15 +523,13 @@ static int hisi_spi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int hisi_spi_remove(struct platform_device *pdev)
+static void hisi_spi_remove(struct platform_device *pdev)
 {
 	struct spi_controller *master = platform_get_drvdata(pdev);
 	struct hisi_spi *hs = spi_controller_get_devdata(master);
 
 	debugfs_remove_recursive(hs->debugfs);
 	spi_unregister_controller(master);
-
-	return 0;
 }
 
 static const struct acpi_device_id hisi_spi_acpi_match[] = {
@@ -542,7 +540,7 @@ MODULE_DEVICE_TABLE(acpi, hisi_spi_acpi_match);
 
 static struct platform_driver hisi_spi_driver = {
 	.probe		= hisi_spi_probe,
-	.remove		= hisi_spi_remove,
+	.remove_new	= hisi_spi_remove,
 	.driver		= {
 		.name	= "hisi-kunpeng-spi",
 		.acpi_match_table = hisi_spi_acpi_match,
-- 
2.39.1


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

* [PATCH 31/87] spi: img-spfi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (29 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 30/87] spi: hisi-kunpeng: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 32/87] spi: iproc-qspi: " Uwe Kleine-König
                   ` (58 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-img-spfi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c
index 257046f843ff..c64e4fd3fdf0 100644
--- a/drivers/spi/spi-img-spfi.c
+++ b/drivers/spi/spi-img-spfi.c
@@ -665,7 +665,7 @@ static int img_spfi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int img_spfi_remove(struct platform_device *pdev)
+static void img_spfi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct img_spfi *spfi = spi_master_get_devdata(master);
@@ -680,8 +680,6 @@ static int img_spfi_remove(struct platform_device *pdev)
 		clk_disable_unprepare(spfi->spfi_clk);
 		clk_disable_unprepare(spfi->sys_clk);
 	}
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -758,7 +756,7 @@ static struct platform_driver img_spfi_driver = {
 		.of_match_table = of_match_ptr(img_spfi_of_match),
 	},
 	.probe = img_spfi_probe,
-	.remove = img_spfi_remove,
+	.remove_new = img_spfi_remove,
 };
 module_platform_driver(img_spfi_driver);
 
-- 
2.39.1


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

* [PATCH 32/87] spi: iproc-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (30 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 31/87] spi: img-spfi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:26   ` Florian Fainelli
  2023-03-03 17:19 ` [PATCH 33/87] spi: lantiq-ssc: " Uwe Kleine-König
                   ` (57 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Kamal Dasu, Mark Brown, Ray Jui, Scott Branden
  Cc: Broadcom internal kernel review list, linux-spi,
	linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-iproc-qspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-iproc-qspi.c b/drivers/spi/spi-iproc-qspi.c
index 91cf8eb7213c..5980a0dbbccb 100644
--- a/drivers/spi/spi-iproc-qspi.c
+++ b/drivers/spi/spi-iproc-qspi.c
@@ -127,11 +127,9 @@ static int bcm_iproc_probe(struct platform_device *pdev)
 	return bcm_qspi_probe(pdev, soc_intc);
 }
 
-static int bcm_iproc_remove(struct platform_device *pdev)
+static void bcm_iproc_remove(struct platform_device *pdev)
 {
 	bcm_qspi_remove(pdev);
-
-	return 0;
 }
 
 static const struct of_device_id bcm_iproc_of_match[] = {
@@ -143,7 +141,7 @@ MODULE_DEVICE_TABLE(of, bcm_iproc_of_match);
 
 static struct platform_driver bcm_iproc_driver = {
 	.probe			= bcm_iproc_probe,
-	.remove			= bcm_iproc_remove,
+	.remove_new		= bcm_iproc_remove,
 	.driver = {
 		.name		= "bcm_iproc",
 		.pm		= &bcm_qspi_pm_ops,
-- 
2.39.1


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

* [PATCH 33/87] spi: lantiq-ssc: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (31 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 32/87] spi: iproc-qspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 34/87] spi: meson-spicc: " Uwe Kleine-König
                   ` (56 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-lantiq-ssc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-lantiq-ssc.c b/drivers/spi/spi-lantiq-ssc.c
index aae26f62ea87..76cf2a66f874 100644
--- a/drivers/spi/spi-lantiq-ssc.c
+++ b/drivers/spi/spi-lantiq-ssc.c
@@ -1017,7 +1017,7 @@ static int lantiq_ssc_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int lantiq_ssc_remove(struct platform_device *pdev)
+static void lantiq_ssc_remove(struct platform_device *pdev)
 {
 	struct lantiq_ssc_spi *spi = platform_get_drvdata(pdev);
 
@@ -1030,13 +1030,11 @@ static int lantiq_ssc_remove(struct platform_device *pdev)
 	destroy_workqueue(spi->wq);
 	clk_disable_unprepare(spi->spi_clk);
 	clk_put(spi->fpi_clk);
-
-	return 0;
 }
 
 static struct platform_driver lantiq_ssc_driver = {
 	.probe = lantiq_ssc_probe,
-	.remove = lantiq_ssc_remove,
+	.remove_new = lantiq_ssc_remove,
 	.driver = {
 		.name = "spi-lantiq-ssc",
 		.of_match_table = lantiq_ssc_match,
-- 
2.39.1


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

* [PATCH 34/87] spi: meson-spicc: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (32 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 33/87] spi: lantiq-ssc: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-04 21:43   ` Martin Blumenstingl
  2023-03-03 17:19 ` [PATCH 35/87] spi: meson-spifc: " Uwe Kleine-König
                   ` (55 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown, Neil Armstrong, Kevin Hilman
  Cc: Jerome Brunet, Martin Blumenstingl, linux-spi, linux-arm-kernel,
	linux-amlogic, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-meson-spicc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c
index d47f2623a60f..b9f812837cd6 100644
--- a/drivers/spi/spi-meson-spicc.c
+++ b/drivers/spi/spi-meson-spicc.c
@@ -910,7 +910,7 @@ static int meson_spicc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int meson_spicc_remove(struct platform_device *pdev)
+static void meson_spicc_remove(struct platform_device *pdev)
 {
 	struct meson_spicc_device *spicc = platform_get_drvdata(pdev);
 
@@ -921,8 +921,6 @@ static int meson_spicc_remove(struct platform_device *pdev)
 	clk_disable_unprepare(spicc->pclk);
 
 	spi_master_put(spicc->master);
-
-	return 0;
 }
 
 static const struct meson_spicc_data meson_spicc_gx_data = {
@@ -967,7 +965,7 @@ MODULE_DEVICE_TABLE(of, meson_spicc_of_match);
 
 static struct platform_driver meson_spicc_driver = {
 	.probe   = meson_spicc_probe,
-	.remove  = meson_spicc_remove,
+	.remove_new = meson_spicc_remove,
 	.driver  = {
 		.name = "meson-spicc",
 		.of_match_table = of_match_ptr(meson_spicc_of_match),
-- 
2.39.1


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

* [PATCH 35/87] spi: meson-spifc: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (33 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 34/87] spi: meson-spicc: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-04 21:43   ` Martin Blumenstingl
  2023-03-03 17:19 ` [PATCH 36/87] spi: microchip-core-qspi: " Uwe Kleine-König
                   ` (54 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown, Neil Armstrong, Kevin Hilman
  Cc: Jerome Brunet, Martin Blumenstingl, linux-spi, linux-arm-kernel,
	linux-amlogic, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-meson-spifc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-meson-spifc.c b/drivers/spi/spi-meson-spifc.c
index c8ed7815c4ba..06626f406f68 100644
--- a/drivers/spi/spi-meson-spifc.c
+++ b/drivers/spi/spi-meson-spifc.c
@@ -355,7 +355,7 @@ static int meson_spifc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int meson_spifc_remove(struct platform_device *pdev)
+static void meson_spifc_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct meson_spifc *spifc = spi_master_get_devdata(master);
@@ -363,8 +363,6 @@ static int meson_spifc_remove(struct platform_device *pdev)
 	pm_runtime_get_sync(&pdev->dev);
 	clk_disable_unprepare(spifc->clk);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -442,7 +440,7 @@ MODULE_DEVICE_TABLE(of, meson_spifc_dt_match);
 
 static struct platform_driver meson_spifc_driver = {
 	.probe	= meson_spifc_probe,
-	.remove	= meson_spifc_remove,
+	.remove_new = meson_spifc_remove,
 	.driver	= {
 		.name		= "meson-spifc",
 		.of_match_table	= of_match_ptr(meson_spifc_dt_match),
-- 
2.39.1


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

* [PATCH 36/87] spi: microchip-core-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (34 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 35/87] spi: meson-spifc: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:45   ` Conor Dooley
  2023-03-03 17:19 ` [PATCH 37/87] spi: microchip-core: " Uwe Kleine-König
                   ` (53 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Conor Dooley, Daire McNamara, Mark Brown; +Cc: linux-riscv, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-microchip-core-qspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-microchip-core-qspi.c b/drivers/spi/spi-microchip-core-qspi.c
index 19a6a46829f6..4f76ddf97b10 100644
--- a/drivers/spi/spi-microchip-core-qspi.c
+++ b/drivers/spi/spi-microchip-core-qspi.c
@@ -566,7 +566,7 @@ static int mchp_coreqspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mchp_coreqspi_remove(struct platform_device *pdev)
+static void mchp_coreqspi_remove(struct platform_device *pdev)
 {
 	struct mchp_coreqspi *qspi = platform_get_drvdata(pdev);
 	u32 control = readl_relaxed(qspi->regs + REG_CONTROL);
@@ -575,8 +575,6 @@ static int mchp_coreqspi_remove(struct platform_device *pdev)
 	control &= ~CONTROL_ENABLE;
 	writel_relaxed(control, qspi->regs + REG_CONTROL);
 	clk_disable_unprepare(qspi->clk);
-
-	return 0;
 }
 
 static const struct of_device_id mchp_coreqspi_of_match[] = {
@@ -591,7 +589,7 @@ static struct platform_driver mchp_coreqspi_driver = {
 		.name = "microchip,coreqspi",
 		.of_match_table = mchp_coreqspi_of_match,
 	},
-	.remove = mchp_coreqspi_remove,
+	.remove_new = mchp_coreqspi_remove,
 };
 module_platform_driver(mchp_coreqspi_driver);
 
-- 
2.39.1


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

* [PATCH 37/87] spi: microchip-core: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (35 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 36/87] spi: microchip-core-qspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:44   ` Conor Dooley
  2023-03-03 17:19 ` [PATCH 38/87] spi: mpc512x-psc: " Uwe Kleine-König
                   ` (52 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Conor Dooley, Daire McNamara, Mark Brown; +Cc: linux-riscv, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-microchip-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
index aeaa1da88f39..e6cf6ff08061 100644
--- a/drivers/spi/spi-microchip-core.c
+++ b/drivers/spi/spi-microchip-core.c
@@ -566,7 +566,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int mchp_corespi_remove(struct platform_device *pdev)
+static void mchp_corespi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master  = platform_get_drvdata(pdev);
 	struct mchp_corespi *spi = spi_master_get_devdata(master);
@@ -574,8 +574,6 @@ static int mchp_corespi_remove(struct platform_device *pdev)
 	mchp_corespi_disable_ints(spi);
 	clk_disable_unprepare(spi->clk);
 	mchp_corespi_disable(spi);
-
-	return 0;
 }
 
 #define MICROCHIP_SPI_PM_OPS (NULL)
@@ -599,7 +597,7 @@ static struct platform_driver mchp_corespi_driver = {
 		.pm = MICROCHIP_SPI_PM_OPS,
 		.of_match_table = of_match_ptr(mchp_corespi_dt_ids),
 	},
-	.remove = mchp_corespi_remove,
+	.remove_new = mchp_corespi_remove,
 };
 module_platform_driver(mchp_corespi_driver);
 MODULE_DESCRIPTION("Microchip coreSPI SPI controller driver");
-- 
2.39.1


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

* [PATCH 38/87] spi: mpc512x-psc: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (36 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 37/87] spi: microchip-core: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 39/87] spi: mpc52xx-psc: " Uwe Kleine-König
                   ` (51 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Fold mpc512x_psc_spi_do_remove() into its only caller and then 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/spi/spi-mpc512x-psc.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c
index 03630359ce70..f5bea6df0690 100644
--- a/drivers/spi/spi-mpc512x-psc.c
+++ b/drivers/spi/spi-mpc512x-psc.c
@@ -561,17 +561,6 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
 	return ret;
 }
 
-static int mpc512x_psc_spi_do_remove(struct device *dev)
-{
-	struct spi_master *master = dev_get_drvdata(dev);
-	struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
-
-	clk_disable_unprepare(mps->clk_mclk);
-	clk_disable_unprepare(mps->clk_ipg);
-
-	return 0;
-}
-
 static int mpc512x_psc_spi_of_probe(struct platform_device *op)
 {
 	const u32 *regaddr_p;
@@ -588,9 +577,14 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *op)
 				irq_of_parse_and_map(op->dev.of_node, 0));
 }
 
-static int mpc512x_psc_spi_of_remove(struct platform_device *op)
+static void mpc512x_psc_spi_of_remove(struct platform_device *op)
 {
-	return mpc512x_psc_spi_do_remove(&op->dev);
+	struct device *dev = &op->dev;
+	struct spi_master *master = dev_get_drvdata(dev);
+	struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
+
+	clk_disable_unprepare(mps->clk_mclk);
+	clk_disable_unprepare(mps->clk_ipg);
 }
 
 static const struct of_device_id mpc512x_psc_spi_of_match[] = {
@@ -603,7 +597,7 @@ MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match);
 
 static struct platform_driver mpc512x_psc_spi_of_driver = {
 	.probe = mpc512x_psc_spi_of_probe,
-	.remove = mpc512x_psc_spi_of_remove,
+	.remove_new = mpc512x_psc_spi_of_remove,
 	.driver = {
 		.name = "mpc512x-psc-spi",
 		.of_match_table = mpc512x_psc_spi_of_match,
-- 
2.39.1


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

* [PATCH 39/87] spi: mpc52xx-psc: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (37 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 38/87] spi: mpc512x-psc: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 40/87] spi: mpc52xx: " Uwe Kleine-König
                   ` (50 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-mpc52xx-psc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c
index 609311231e64..4a2b1b56cc92 100644
--- a/drivers/spi/spi-mpc52xx-psc.c
+++ b/drivers/spi/spi-mpc52xx-psc.c
@@ -418,7 +418,7 @@ static int mpc52xx_psc_spi_of_probe(struct platform_device *op)
 				irq_of_parse_and_map(op->dev.of_node, 0), id);
 }
 
-static int mpc52xx_psc_spi_of_remove(struct platform_device *op)
+static void mpc52xx_psc_spi_of_remove(struct platform_device *op)
 {
 	struct spi_master *master = spi_master_get(platform_get_drvdata(op));
 	struct mpc52xx_psc_spi *mps = spi_master_get_devdata(master);
@@ -428,8 +428,6 @@ static int mpc52xx_psc_spi_of_remove(struct platform_device *op)
 	if (mps->psc)
 		iounmap(mps->psc);
 	spi_master_put(master);
-
-	return 0;
 }
 
 static const struct of_device_id mpc52xx_psc_spi_of_match[] = {
@@ -442,7 +440,7 @@ MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match);
 
 static struct platform_driver mpc52xx_psc_spi_of_driver = {
 	.probe = mpc52xx_psc_spi_of_probe,
-	.remove = mpc52xx_psc_spi_of_remove,
+	.remove_new = mpc52xx_psc_spi_of_remove,
 	.driver = {
 		.name = "mpc52xx-psc-spi",
 		.of_match_table = mpc52xx_psc_spi_of_match,
-- 
2.39.1


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

* [PATCH 40/87] spi: mpc52xx: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (38 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 39/87] spi: mpc52xx-psc: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 41/87] spi: mtk-nor: " Uwe Kleine-König
                   ` (49 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-mpc52xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-mpc52xx.c b/drivers/spi/spi-mpc52xx.c
index 7b64e64c65cf..b652fb196622 100644
--- a/drivers/spi/spi-mpc52xx.c
+++ b/drivers/spi/spi-mpc52xx.c
@@ -513,7 +513,7 @@ static int mpc52xx_spi_probe(struct platform_device *op)
 	return rc;
 }
 
-static int mpc52xx_spi_remove(struct platform_device *op)
+static void mpc52xx_spi_remove(struct platform_device *op)
 {
 	struct spi_master *master = spi_master_get(platform_get_drvdata(op));
 	struct mpc52xx_spi *ms = spi_master_get_devdata(master);
@@ -529,8 +529,6 @@ static int mpc52xx_spi_remove(struct platform_device *op)
 	spi_unregister_master(master);
 	iounmap(ms->regs);
 	spi_master_put(master);
-
-	return 0;
 }
 
 static const struct of_device_id mpc52xx_spi_match[] = {
@@ -545,6 +543,6 @@ static struct platform_driver mpc52xx_spi_of_driver = {
 		.of_match_table = mpc52xx_spi_match,
 	},
 	.probe = mpc52xx_spi_probe,
-	.remove = mpc52xx_spi_remove,
+	.remove_new = mpc52xx_spi_remove,
 };
 module_platform_driver(mpc52xx_spi_of_driver);
-- 
2.39.1


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

* [PATCH 41/87] spi: mtk-nor: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (39 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 40/87] spi: mpc52xx: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 42/87] spi: mtk-snfi: " Uwe Kleine-König
                   ` (48 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown, Matthias Brugger
  Cc: AngeloGioacchino Del Regno, linux-spi, 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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-mtk-nor.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c
index aad92a58c4b8..baa7a5353987 100644
--- a/drivers/spi/spi-mtk-nor.c
+++ b/drivers/spi/spi-mtk-nor.c
@@ -934,7 +934,7 @@ static int mtk_nor_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mtk_nor_remove(struct platform_device *pdev)
+static void mtk_nor_remove(struct platform_device *pdev)
 {
 	struct spi_controller *ctlr = dev_get_drvdata(&pdev->dev);
 	struct mtk_nor *sp = spi_controller_get_devdata(ctlr);
@@ -944,8 +944,6 @@ static int mtk_nor_remove(struct platform_device *pdev)
 	pm_runtime_dont_use_autosuspend(&pdev->dev);
 
 	mtk_nor_disable_clk(sp);
-
-	return 0;
 }
 
 static int __maybe_unused mtk_nor_runtime_suspend(struct device *dev)
@@ -999,7 +997,7 @@ static struct platform_driver mtk_nor_driver = {
 		.pm = &mtk_nor_pm_ops,
 	},
 	.probe = mtk_nor_probe,
-	.remove = mtk_nor_remove,
+	.remove_new = mtk_nor_remove,
 };
 
 module_platform_driver(mtk_nor_driver);
-- 
2.39.1


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

* [PATCH 42/87] spi: mtk-snfi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (40 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 41/87] spi: mtk-nor: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 43/87] spi: mxic: " Uwe Kleine-König
                   ` (47 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown, Matthias Brugger
  Cc: AngeloGioacchino Del Regno, linux-spi, 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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-mtk-snfi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-mtk-snfi.c b/drivers/spi/spi-mtk-snfi.c
index f3f95eb37365..bed8317cd205 100644
--- a/drivers/spi/spi-mtk-snfi.c
+++ b/drivers/spi/spi-mtk-snfi.c
@@ -1506,7 +1506,7 @@ static int mtk_snand_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mtk_snand_remove(struct platform_device *pdev)
+static void mtk_snand_remove(struct platform_device *pdev)
 {
 	struct spi_controller *ctlr = platform_get_drvdata(pdev);
 	struct mtk_snand *ms = spi_controller_get_devdata(ctlr);
@@ -1515,12 +1515,11 @@ static int mtk_snand_remove(struct platform_device *pdev)
 	mtk_snand_disable_clk(ms);
 	mtk_ecc_release(ms->ecc);
 	kfree(ms->buf);
-	return 0;
 }
 
 static struct platform_driver mtk_snand_driver = {
 	.probe = mtk_snand_probe,
-	.remove = mtk_snand_remove,
+	.remove_new = mtk_snand_remove,
 	.driver = {
 		.name = "mtk-snand",
 		.of_match_table = mtk_snand_ids,
-- 
2.39.1


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

* [PATCH 43/87] spi: mxic: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (41 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 42/87] spi: mtk-snfi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 44/87] spi: mxs: " Uwe Kleine-König
                   ` (46 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-mxic.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c
index a3dba17390eb..10727ea53043 100644
--- a/drivers/spi/spi-mxic.c
+++ b/drivers/spi/spi-mxic.c
@@ -818,7 +818,7 @@ static int mxic_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mxic_spi_remove(struct platform_device *pdev)
+static void mxic_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct mxic_spi *mxic = spi_master_get_devdata(master);
@@ -826,8 +826,6 @@ static int mxic_spi_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 	mxic_spi_mem_ecc_remove(mxic);
 	spi_unregister_master(master);
-
-	return 0;
 }
 
 static const struct of_device_id mxic_spi_of_ids[] = {
@@ -838,7 +836,7 @@ MODULE_DEVICE_TABLE(of, mxic_spi_of_ids);
 
 static struct platform_driver mxic_spi_driver = {
 	.probe = mxic_spi_probe,
-	.remove = mxic_spi_remove,
+	.remove_new = mxic_spi_remove,
 	.driver = {
 		.name = "mxic-spi",
 		.of_match_table = mxic_spi_of_ids,
-- 
2.39.1


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

* [PATCH 44/87] spi: mxs: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (42 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 43/87] spi: mxic: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:19 ` [PATCH 45/87] spi: npcm-fiu: " Uwe Kleine-König
                   ` (45 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Mark Brown, Shawn Guo, Sascha Hauer
  Cc: Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	linux-spi, linux-arm-kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-mxs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index 55178579f3c6..10fb31a5e409 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -638,7 +638,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mxs_spi_remove(struct platform_device *pdev)
+static void mxs_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master;
 	struct mxs_spi *spi;
@@ -653,13 +653,11 @@ static int mxs_spi_remove(struct platform_device *pdev)
 		mxs_spi_runtime_suspend(&pdev->dev);
 
 	dma_release_channel(ssp->dmach);
-
-	return 0;
 }
 
 static struct platform_driver mxs_spi_driver = {
 	.probe	= mxs_spi_probe,
-	.remove	= mxs_spi_remove,
+	.remove_new = mxs_spi_remove,
 	.driver	= {
 		.name	= DRIVER_NAME,
 		.of_match_table = mxs_spi_dt_ids,
-- 
2.39.1


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

* [PATCH 45/87] spi: npcm-fiu: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (43 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 44/87] spi: mxs: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 46/87] spi: npcm-pspi: " Uwe Kleine-König
                   ` (44 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
  To: Avi Fishman, Tomer Maimon, Tali Perry, Mark Brown
  Cc: Patrick Venture, Nancy Yuen, Benjamin Fair, openbmc, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-npcm-fiu.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c
index 559d3a5b4062..8d7698d167ef 100644
--- a/drivers/spi/spi-npcm-fiu.c
+++ b/drivers/spi/spi-npcm-fiu.c
@@ -762,12 +762,11 @@ static int npcm_fiu_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int npcm_fiu_remove(struct platform_device *pdev)
+static void npcm_fiu_remove(struct platform_device *pdev)
 {
 	struct npcm_fiu_spi *fiu = platform_get_drvdata(pdev);
 
 	clk_disable_unprepare(fiu->clk);
-	return 0;
 }
 
 MODULE_DEVICE_TABLE(of, npcm_fiu_dt_ids);
@@ -779,7 +778,7 @@ static struct platform_driver npcm_fiu_driver = {
 		.of_match_table = npcm_fiu_dt_ids,
 	},
 	.probe      = npcm_fiu_probe,
-	.remove	    = npcm_fiu_remove,
+	.remove_new	    = npcm_fiu_remove,
 };
 module_platform_driver(npcm_fiu_driver);
 
-- 
2.39.1


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

* [PATCH 46/87] spi: npcm-pspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (44 preceding siblings ...)
  2023-03-03 17:19 ` [PATCH 45/87] spi: npcm-fiu: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 47/87] spi: nxp-fspi: " Uwe Kleine-König
                   ` (43 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Avi Fishman, Tomer Maimon, Tali Perry, Mark Brown
  Cc: Patrick Venture, Nancy Yuen, Benjamin Fair, openbmc, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-npcm-pspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-npcm-pspi.c b/drivers/spi/spi-npcm-pspi.c
index 7f2e4d1b0d43..64585c2a25c5 100644
--- a/drivers/spi/spi-npcm-pspi.c
+++ b/drivers/spi/spi-npcm-pspi.c
@@ -430,15 +430,13 @@ static int npcm_pspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int npcm_pspi_remove(struct platform_device *pdev)
+static void npcm_pspi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct npcm_pspi *priv = spi_master_get_devdata(master);
 
 	npcm_pspi_reset_hw(priv);
 	clk_disable_unprepare(priv->clk);
-
-	return 0;
 }
 
 static const struct of_device_id npcm_pspi_match[] = {
@@ -454,7 +452,7 @@ static struct platform_driver npcm_pspi_driver = {
 		.of_match_table	= npcm_pspi_match,
 	},
 	.probe		= npcm_pspi_probe,
-	.remove		= npcm_pspi_remove,
+	.remove_new	= npcm_pspi_remove,
 };
 module_platform_driver(npcm_pspi_driver);
 
-- 
2.39.1


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

* [PATCH 47/87] spi: nxp-fspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (45 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 46/87] spi: npcm-pspi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 48/87] spi: oc-tiny: " Uwe Kleine-König
                   ` (42 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Han Xu, Haibo Chen, Mark Brown; +Cc: Yogesh Gaur, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-nxp-fspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index 1c1991a26c15..71be1ec3fbde 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -1195,7 +1195,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int nxp_fspi_remove(struct platform_device *pdev)
+static void nxp_fspi_remove(struct platform_device *pdev)
 {
 	struct nxp_fspi *f = platform_get_drvdata(pdev);
 
@@ -1208,8 +1208,6 @@ static int nxp_fspi_remove(struct platform_device *pdev)
 
 	if (f->ahb_addr)
 		iounmap(f->ahb_addr);
-
-	return 0;
 }
 
 static int nxp_fspi_suspend(struct device *dev)
@@ -1257,7 +1255,7 @@ static struct platform_driver nxp_fspi_driver = {
 		.pm =   &nxp_fspi_pm_ops,
 	},
 	.probe          = nxp_fspi_probe,
-	.remove		= nxp_fspi_remove,
+	.remove_new	= nxp_fspi_remove,
 };
 module_platform_driver(nxp_fspi_driver);
 
-- 
2.39.1


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

* [PATCH 48/87] spi: oc-tiny: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (46 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 47/87] spi: nxp-fspi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 49/87] spi: omap-uwire: " Uwe Kleine-König
                   ` (41 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-oc-tiny.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-oc-tiny.c b/drivers/spi/spi-oc-tiny.c
index 38c14c4e4e21..3af499838e84 100644
--- a/drivers/spi/spi-oc-tiny.c
+++ b/drivers/spi/spi-oc-tiny.c
@@ -271,14 +271,13 @@ static int tiny_spi_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int tiny_spi_remove(struct platform_device *pdev)
+static void tiny_spi_remove(struct platform_device *pdev)
 {
 	struct tiny_spi *hw = platform_get_drvdata(pdev);
 	struct spi_master *master = hw->bitbang.master;
 
 	spi_bitbang_stop(&hw->bitbang);
 	spi_master_put(master);
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -291,7 +290,7 @@ MODULE_DEVICE_TABLE(of, tiny_spi_match);
 
 static struct platform_driver tiny_spi_driver = {
 	.probe = tiny_spi_probe,
-	.remove = tiny_spi_remove,
+	.remove_new = tiny_spi_remove,
 	.driver = {
 		.name = DRV_NAME,
 		.pm = NULL,
-- 
2.39.1


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

* [PATCH 49/87] spi: omap-uwire: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (47 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 48/87] spi: oc-tiny: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 50/87] spi: omap2-mcspi: " Uwe Kleine-König
                   ` (40 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-omap-uwire.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c
index 20c87163d612..6da77de19e2b 100644
--- a/drivers/spi/spi-omap-uwire.c
+++ b/drivers/spi/spi-omap-uwire.c
@@ -505,7 +505,7 @@ static int uwire_probe(struct platform_device *pdev)
 	return status;
 }
 
-static int uwire_remove(struct platform_device *pdev)
+static void uwire_remove(struct platform_device *pdev)
 {
 	struct uwire_spi	*uwire = platform_get_drvdata(pdev);
 
@@ -513,7 +513,6 @@ static int uwire_remove(struct platform_device *pdev)
 
 	spi_bitbang_stop(&uwire->bitbang);
 	uwire_off(uwire);
-	return 0;
 }
 
 /* work with hotplug and coldplug */
@@ -524,7 +523,7 @@ static struct platform_driver uwire_driver = {
 		.name		= "omap_uwire",
 	},
 	.probe = uwire_probe,
-	.remove = uwire_remove,
+	.remove_new = uwire_remove,
 	// suspend ... unuse ck
 	// resume ... use ck
 };
-- 
2.39.1


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

* [PATCH 50/87] spi: omap2-mcspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (48 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 49/87] spi: omap-uwire: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 51/87] spi: orion: " Uwe Kleine-König
                   ` (39 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-omap2-mcspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 6ba9b0d7710b..ce3cdd540420 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1546,7 +1546,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 	return status;
 }
 
-static int omap2_mcspi_remove(struct platform_device *pdev)
+static void omap2_mcspi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct omap2_mcspi *mcspi = spi_master_get_devdata(master);
@@ -1556,8 +1556,6 @@ static int omap2_mcspi_remove(struct platform_device *pdev)
 	pm_runtime_dont_use_autosuspend(mcspi->dev);
 	pm_runtime_put_sync(mcspi->dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 /* work with hotplug and coldplug */
@@ -1610,7 +1608,7 @@ static struct platform_driver omap2_mcspi_driver = {
 		.of_match_table = omap_mcspi_of_match,
 	},
 	.probe =	omap2_mcspi_probe,
-	.remove =	omap2_mcspi_remove,
+	.remove_new =	omap2_mcspi_remove,
 };
 
 module_platform_driver(omap2_mcspi_driver);
-- 
2.39.1


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

* [PATCH 51/87] spi: orion: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (49 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 50/87] spi: omap2-mcspi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 52/87] spi: pic32-sqi: " Uwe Kleine-König
                   ` (38 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-orion.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index 565cd4c48d7b..e79d1fe0bca4 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -805,7 +805,7 @@ static int orion_spi_probe(struct platform_device *pdev)
 }
 
 
-static int orion_spi_remove(struct platform_device *pdev)
+static void orion_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct orion_spi *spi = spi_master_get_devdata(master);
@@ -816,8 +816,6 @@ static int orion_spi_remove(struct platform_device *pdev)
 
 	spi_unregister_master(master);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 MODULE_ALIAS("platform:" DRIVER_NAME);
@@ -857,7 +855,7 @@ static struct platform_driver orion_spi_driver = {
 		.of_match_table = of_match_ptr(orion_spi_of_match_table),
 	},
 	.probe		= orion_spi_probe,
-	.remove		= orion_spi_remove,
+	.remove_new	= orion_spi_remove,
 };
 
 module_platform_driver(orion_spi_driver);
-- 
2.39.1


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

* [PATCH 52/87] spi: pic32-sqi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (50 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 51/87] spi: orion: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 53/87] spi: pic32: " Uwe Kleine-König
                   ` (37 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-pic32-sqi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-pic32-sqi.c b/drivers/spi/spi-pic32-sqi.c
index 86ad17597f5f..4c8493f34fca 100644
--- a/drivers/spi/spi-pic32-sqi.c
+++ b/drivers/spi/spi-pic32-sqi.c
@@ -678,7 +678,7 @@ static int pic32_sqi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pic32_sqi_remove(struct platform_device *pdev)
+static void pic32_sqi_remove(struct platform_device *pdev)
 {
 	struct pic32_sqi *sqi = platform_get_drvdata(pdev);
 
@@ -689,8 +689,6 @@ static int pic32_sqi_remove(struct platform_device *pdev)
 	/* disable clk */
 	clk_disable_unprepare(sqi->base_clk);
 	clk_disable_unprepare(sqi->sys_clk);
-
-	return 0;
 }
 
 static const struct of_device_id pic32_sqi_of_ids[] = {
@@ -705,7 +703,7 @@ static struct platform_driver pic32_sqi_driver = {
 		.of_match_table = of_match_ptr(pic32_sqi_of_ids),
 	},
 	.probe = pic32_sqi_probe,
-	.remove = pic32_sqi_remove,
+	.remove_new = pic32_sqi_remove,
 };
 
 module_platform_driver(pic32_sqi_driver);
-- 
2.39.1


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

* [PATCH 53/87] spi: pic32: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (51 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 52/87] spi: pic32-sqi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 54/87] spi: ppc4xx: " Uwe Kleine-König
                   ` (36 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-pic32.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c
index 7e5c09a7d489..5a64ad0c94fe 100644
--- a/drivers/spi/spi-pic32.c
+++ b/drivers/spi/spi-pic32.c
@@ -844,7 +844,7 @@ static int pic32_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pic32_spi_remove(struct platform_device *pdev)
+static void pic32_spi_remove(struct platform_device *pdev)
 {
 	struct pic32_spi *pic32s;
 
@@ -852,8 +852,6 @@ static int pic32_spi_remove(struct platform_device *pdev)
 	pic32_spi_disable(pic32s);
 	clk_disable_unprepare(pic32s->clk);
 	pic32_spi_dma_unprep(pic32s);
-
-	return 0;
 }
 
 static const struct of_device_id pic32_spi_of_match[] = {
@@ -868,7 +866,7 @@ static struct platform_driver pic32_spi_driver = {
 		.of_match_table = of_match_ptr(pic32_spi_of_match),
 	},
 	.probe = pic32_spi_probe,
-	.remove = pic32_spi_remove,
+	.remove_new = pic32_spi_remove,
 };
 
 module_platform_driver(pic32_spi_driver);
-- 
2.39.1


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

* [PATCH 54/87] spi: ppc4xx: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (52 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 53/87] spi: pic32: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 55/87] spi: pxa2xx: " Uwe Kleine-König
                   ` (35 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-ppc4xx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c
index d65f047b6c82..d725e915025d 100644
--- a/drivers/spi/spi-ppc4xx.c
+++ b/drivers/spi/spi-ppc4xx.c
@@ -464,7 +464,7 @@ static int spi_ppc4xx_of_probe(struct platform_device *op)
 	return ret;
 }
 
-static int spi_ppc4xx_of_remove(struct platform_device *op)
+static void spi_ppc4xx_of_remove(struct platform_device *op)
 {
 	struct spi_master *master = platform_get_drvdata(op);
 	struct ppc4xx_spi *hw = spi_master_get_devdata(master);
@@ -474,7 +474,6 @@ static int spi_ppc4xx_of_remove(struct platform_device *op)
 	free_irq(hw->irqnum, hw);
 	iounmap(hw->regs);
 	spi_master_put(master);
-	return 0;
 }
 
 static const struct of_device_id spi_ppc4xx_of_match[] = {
@@ -486,7 +485,7 @@ MODULE_DEVICE_TABLE(of, spi_ppc4xx_of_match);
 
 static struct platform_driver spi_ppc4xx_of_driver = {
 	.probe = spi_ppc4xx_of_probe,
-	.remove = spi_ppc4xx_of_remove,
+	.remove_new = spi_ppc4xx_of_remove,
 	.driver = {
 		.name = DRIVER_NAME,
 		.of_match_table = spi_ppc4xx_of_match,
-- 
2.39.1


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

* [PATCH 55/87] spi: pxa2xx: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (53 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 54/87] spi: ppc4xx: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 56/87] spi: qcom-qspi: " Uwe Kleine-König
                   ` (34 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Mark Brown
  Cc: linux-arm-kernel, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-pxa2xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 32cc82a89ec1..a75ba2993f3c 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1659,7 +1659,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 	return status;
 }
 
-static int pxa2xx_spi_remove(struct platform_device *pdev)
+static void pxa2xx_spi_remove(struct platform_device *pdev)
 {
 	struct driver_data *drv_data = platform_get_drvdata(pdev);
 	struct ssp_device *ssp = drv_data->ssp;
@@ -1684,8 +1684,6 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
 
 	/* Release SSP */
 	pxa_ssp_free(ssp);
-
-	return 0;
 }
 
 static int pxa2xx_spi_suspend(struct device *dev)
@@ -1770,7 +1768,7 @@ static struct platform_driver driver = {
 		.of_match_table = of_match_ptr(pxa2xx_spi_of_match),
 	},
 	.probe = pxa2xx_spi_probe,
-	.remove = pxa2xx_spi_remove,
+	.remove_new = pxa2xx_spi_remove,
 };
 
 static int __init pxa2xx_spi_init(void)
-- 
2.39.1


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

* [PATCH 56/87] spi: qcom-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (54 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 55/87] spi: pxa2xx: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 57/87] spi: rb4xx: " Uwe Kleine-König
                   ` (33 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Mark Brown
  Cc: Konrad Dybcio, linux-arm-msm, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-qcom-qspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c
index c334dfec4117..15c4e21cd562 100644
--- a/drivers/spi/spi-qcom-qspi.c
+++ b/drivers/spi/spi-qcom-qspi.c
@@ -552,7 +552,7 @@ static int qcom_qspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int qcom_qspi_remove(struct platform_device *pdev)
+static void qcom_qspi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 
@@ -560,8 +560,6 @@ static int qcom_qspi_remove(struct platform_device *pdev)
 	spi_unregister_master(master);
 
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static int __maybe_unused qcom_qspi_runtime_suspend(struct device *dev)
@@ -655,7 +653,7 @@ static struct platform_driver qcom_qspi_driver = {
 		.of_match_table = qcom_qspi_dt_match,
 	},
 	.probe = qcom_qspi_probe,
-	.remove = qcom_qspi_remove,
+	.remove_new = qcom_qspi_remove,
 };
 module_platform_driver(qcom_qspi_driver);
 
-- 
2.39.1


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

* [PATCH 57/87] spi: rb4xx: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (55 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 56/87] spi: qcom-qspi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 58/87] spi: rockchip-sfc: " Uwe Kleine-König
                   ` (32 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-rb4xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-rb4xx.c b/drivers/spi/spi-rb4xx.c
index 9f97d18a05c1..e312b30b733b 100644
--- a/drivers/spi/spi-rb4xx.c
+++ b/drivers/spi/spi-rb4xx.c
@@ -181,13 +181,11 @@ static int rb4xx_spi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rb4xx_spi_remove(struct platform_device *pdev)
+static void rb4xx_spi_remove(struct platform_device *pdev)
 {
 	struct rb4xx_spi *rbspi = platform_get_drvdata(pdev);
 
 	clk_disable_unprepare(rbspi->clk);
-
-	return 0;
 }
 
 static const struct of_device_id rb4xx_spi_dt_match[] = {
@@ -198,7 +196,7 @@ MODULE_DEVICE_TABLE(of, rb4xx_spi_dt_match);
 
 static struct platform_driver rb4xx_spi_drv = {
 	.probe = rb4xx_spi_probe,
-	.remove = rb4xx_spi_remove,
+	.remove_new = rb4xx_spi_remove,
 	.driver = {
 		.name = "rb4xx-spi",
 		.of_match_table = of_match_ptr(rb4xx_spi_dt_match),
-- 
2.39.1


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

* [PATCH 58/87] spi: rockchip-sfc: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (56 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 57/87] spi: rb4xx: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 59/87] spi: rockchip: " Uwe Kleine-König
                   ` (31 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Heiko Stuebner
  Cc: linux-spi, linux-arm-kernel, linux-rockchip, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-rockchip-sfc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
index bd87d3c92dd3..80e1ee110d31 100644
--- a/drivers/spi/spi-rockchip-sfc.c
+++ b/drivers/spi/spi-rockchip-sfc.c
@@ -656,7 +656,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int rockchip_sfc_remove(struct platform_device *pdev)
+static void rockchip_sfc_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct rockchip_sfc *sfc = platform_get_drvdata(pdev);
@@ -665,8 +665,6 @@ static int rockchip_sfc_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(sfc->clk);
 	clk_disable_unprepare(sfc->hclk);
-
-	return 0;
 }
 
 static const struct of_device_id rockchip_sfc_dt_ids[] = {
@@ -681,7 +679,7 @@ static struct platform_driver rockchip_sfc_driver = {
 		.of_match_table = rockchip_sfc_dt_ids,
 	},
 	.probe	= rockchip_sfc_probe,
-	.remove	= rockchip_sfc_remove,
+	.remove_new = rockchip_sfc_remove,
 };
 module_platform_driver(rockchip_sfc_driver);
 
-- 
2.39.1


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

* [PATCH 59/87] spi: rockchip: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (57 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 58/87] spi: rockchip-sfc: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 60/87] spi: rpc-if: " Uwe Kleine-König
                   ` (30 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Heiko Stuebner
  Cc: linux-spi, linux-arm-kernel, linux-rockchip, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-rockchip.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 79242dc5272d..8888a5ff7b2f 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -947,7 +947,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int rockchip_spi_remove(struct platform_device *pdev)
+static void rockchip_spi_remove(struct platform_device *pdev)
 {
 	struct spi_controller *ctlr = spi_controller_get(platform_get_drvdata(pdev));
 	struct rockchip_spi *rs = spi_controller_get_devdata(ctlr);
@@ -967,8 +967,6 @@ static int rockchip_spi_remove(struct platform_device *pdev)
 		dma_release_channel(ctlr->dma_rx);
 
 	spi_controller_put(ctlr);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -1076,7 +1074,7 @@ static struct platform_driver rockchip_spi_driver = {
 		.of_match_table = of_match_ptr(rockchip_spi_dt_match),
 	},
 	.probe = rockchip_spi_probe,
-	.remove = rockchip_spi_remove,
+	.remove_new = rockchip_spi_remove,
 };
 
 module_platform_driver(rockchip_spi_driver);
-- 
2.39.1


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

* [PATCH 60/87] spi: rpc-if: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (58 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 59/87] spi: rockchip: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 61/87] spi: rspi: " Uwe Kleine-König
                   ` (29 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-rpc-if.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c
index ec0904faf3a1..2f78124a1b59 100644
--- a/drivers/spi/spi-rpc-if.c
+++ b/drivers/spi/spi-rpc-if.c
@@ -173,15 +173,13 @@ static int rpcif_spi_probe(struct platform_device *pdev)
 	return error;
 }
 
-static int rpcif_spi_remove(struct platform_device *pdev)
+static void rpcif_spi_remove(struct platform_device *pdev)
 {
 	struct spi_controller *ctlr = platform_get_drvdata(pdev);
 	struct rpcif *rpc = spi_controller_get_devdata(ctlr);
 
 	spi_unregister_controller(ctlr);
 	pm_runtime_disable(rpc->dev);
-
-	return 0;
 }
 
 static int __maybe_unused rpcif_spi_suspend(struct device *dev)
@@ -202,7 +200,7 @@ static SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume);
 
 static struct platform_driver rpcif_spi_driver = {
 	.probe	= rpcif_spi_probe,
-	.remove	= rpcif_spi_remove,
+	.remove_new = rpcif_spi_remove,
 	.driver = {
 		.name	= "rpc-if-spi",
 #ifdef CONFIG_PM_SLEEP
-- 
2.39.1


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

* [PATCH 61/87] spi: rspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (59 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 60/87] spi: rpc-if: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 62/87] spi: s3c64xx: " Uwe Kleine-König
                   ` (28 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-rspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 411b1307b7fd..f494c86bafea 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -1172,14 +1172,12 @@ static void rspi_release_dma(struct spi_controller *ctlr)
 		dma_release_channel(ctlr->dma_rx);
 }
 
-static int rspi_remove(struct platform_device *pdev)
+static void rspi_remove(struct platform_device *pdev)
 {
 	struct rspi_data *rspi = platform_get_drvdata(pdev);
 
 	rspi_release_dma(rspi->ctlr);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static const struct spi_ops rspi_ops = {
@@ -1440,7 +1438,7 @@ static SIMPLE_DEV_PM_OPS(rspi_pm_ops, rspi_suspend, rspi_resume);
 
 static struct platform_driver rspi_driver = {
 	.probe =	rspi_probe,
-	.remove =	rspi_remove,
+	.remove_new =	rspi_remove,
 	.id_table =	spi_driver_ids,
 	.driver		= {
 		.name = "renesas_spi",
-- 
2.39.1


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

* [PATCH 62/87] spi: s3c64xx: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (60 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 61/87] spi: rspi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 63/87] spi: sh-hspi: " Uwe Kleine-König
                   ` (27 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andi Shyti, Mark Brown
  Cc: Alim Akhtar, linux-spi, linux-samsung-soc, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-s3c64xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 71d324ec9a70..cc69f8ffdbdc 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1286,7 +1286,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int s3c64xx_spi_remove(struct platform_device *pdev)
+static void s3c64xx_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
@@ -1309,8 +1309,6 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
 	pm_runtime_put_noidle(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -1531,7 +1529,7 @@ static struct platform_driver s3c64xx_spi_driver = {
 		.of_match_table = of_match_ptr(s3c64xx_spi_dt_match),
 	},
 	.probe = s3c64xx_spi_probe,
-	.remove = s3c64xx_spi_remove,
+	.remove_new = s3c64xx_spi_remove,
 	.id_table = s3c64xx_spi_driver_ids,
 };
 MODULE_ALIAS("platform:s3c64xx-spi");
-- 
2.39.1


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

* [PATCH 63/87] spi: sh-hspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (61 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 62/87] spi: s3c64xx: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 64/87] spi: sh-msiof: " Uwe Kleine-König
                   ` (26 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-sh-hspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c
index a62034e2a7cb..d6ffeae66ed3 100644
--- a/drivers/spi/spi-sh-hspi.c
+++ b/drivers/spi/spi-sh-hspi.c
@@ -276,15 +276,13 @@ static int hspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int hspi_remove(struct platform_device *pdev)
+static void hspi_remove(struct platform_device *pdev)
 {
 	struct hspi_priv *hspi = platform_get_drvdata(pdev);
 
 	pm_runtime_disable(&pdev->dev);
 
 	clk_put(hspi->clk);
-
-	return 0;
 }
 
 static const struct of_device_id hspi_of_match[] = {
@@ -295,7 +293,7 @@ MODULE_DEVICE_TABLE(of, hspi_of_match);
 
 static struct platform_driver hspi_driver = {
 	.probe = hspi_probe,
-	.remove = hspi_remove,
+	.remove_new = hspi_remove,
 	.driver = {
 		.name = "sh-hspi",
 		.of_match_table = hspi_of_match,
-- 
2.39.1


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

* [PATCH 64/87] spi: sh-msiof: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (62 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 63/87] spi: sh-hspi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 65/87] spi: sh-sci: " Uwe Kleine-König
                   ` (25 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-sh-msiof.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 9bca3d076f05..d828a3b370b8 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -1375,13 +1375,12 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sh_msiof_spi_remove(struct platform_device *pdev)
+static void sh_msiof_spi_remove(struct platform_device *pdev)
 {
 	struct sh_msiof_spi_priv *p = platform_get_drvdata(pdev);
 
 	sh_msiof_release_dma(p);
 	pm_runtime_disable(&pdev->dev);
-	return 0;
 }
 
 static const struct platform_device_id spi_driver_ids[] = {
@@ -1414,7 +1413,7 @@ static SIMPLE_DEV_PM_OPS(sh_msiof_spi_pm_ops, sh_msiof_spi_suspend,
 
 static struct platform_driver sh_msiof_spi_drv = {
 	.probe		= sh_msiof_spi_probe,
-	.remove		= sh_msiof_spi_remove,
+	.remove_new	= sh_msiof_spi_remove,
 	.id_table	= spi_driver_ids,
 	.driver		= {
 		.name		= "spi_sh_msiof",
-- 
2.39.1


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

* [PATCH 65/87] spi: sh-sci: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (63 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 64/87] spi: sh-msiof: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 66/87] spi: sh: " Uwe Kleine-König
                   ` (24 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-sh-sci.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-sh-sci.c b/drivers/spi/spi-sh-sci.c
index 8f30531e1418..0fdfec2de47a 100644
--- a/drivers/spi/spi-sh-sci.c
+++ b/drivers/spi/spi-sh-sci.c
@@ -171,7 +171,7 @@ static int sh_sci_spi_probe(struct platform_device *dev)
 	return ret;
 }
 
-static int sh_sci_spi_remove(struct platform_device *dev)
+static void sh_sci_spi_remove(struct platform_device *dev)
 {
 	struct sh_sci_spi *sp = platform_get_drvdata(dev);
 
@@ -179,12 +179,11 @@ static int sh_sci_spi_remove(struct platform_device *dev)
 	setbits(sp, PIN_INIT, 0);
 	iounmap(sp->membase);
 	spi_master_put(sp->bitbang.master);
-	return 0;
 }
 
 static struct platform_driver sh_sci_spi_drv = {
 	.probe		= sh_sci_spi_probe,
-	.remove		= sh_sci_spi_remove,
+	.remove_new	= sh_sci_spi_remove,
 	.driver		= {
 		.name	= "spi_sh_sci",
 	},
-- 
2.39.1


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

* [PATCH 66/87] spi: sh: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (64 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 65/87] spi: sh-sci: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 67/87] spi: sifive: " Uwe Kleine-König
                   ` (23 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-sh.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-sh.c b/drivers/spi/spi-sh.c
index 3e72fad99adf..d358a2a9c3f5 100644
--- a/drivers/spi/spi-sh.c
+++ b/drivers/spi/spi-sh.c
@@ -377,14 +377,12 @@ static irqreturn_t spi_sh_irq(int irq, void *_ss)
 	return IRQ_HANDLED;
 }
 
-static int spi_sh_remove(struct platform_device *pdev)
+static void spi_sh_remove(struct platform_device *pdev)
 {
 	struct spi_sh_data *ss = platform_get_drvdata(pdev);
 
 	spi_unregister_master(ss->master);
 	free_irq(ss->irq, ss);
-
-	return 0;
 }
 
 static int spi_sh_probe(struct platform_device *pdev)
@@ -461,7 +459,7 @@ static int spi_sh_probe(struct platform_device *pdev)
 
 static struct platform_driver spi_sh_driver = {
 	.probe = spi_sh_probe,
-	.remove = spi_sh_remove,
+	.remove_new = spi_sh_remove,
 	.driver = {
 		.name = "sh_spi",
 	},
-- 
2.39.1


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

* [PATCH 67/87] spi: sifive: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (65 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 66/87] spi: sh: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:46   ` Conor Dooley
  2023-03-03 17:20 ` [PATCH 68/87] spi: slave-mt27xx: " Uwe Kleine-König
                   ` (22 subsequent siblings)
  89 siblings, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Palmer Dabbelt, Paul Walmsley; +Cc: linux-spi, linux-riscv, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-sifive.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-sifive.c b/drivers/spi/spi-sifive.c
index e29e85cee88a..055de44e0d22 100644
--- a/drivers/spi/spi-sifive.c
+++ b/drivers/spi/spi-sifive.c
@@ -415,7 +415,7 @@ static int sifive_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sifive_spi_remove(struct platform_device *pdev)
+static void sifive_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct sifive_spi *spi = spi_master_get_devdata(master);
@@ -423,8 +423,6 @@ static int sifive_spi_remove(struct platform_device *pdev)
 	/* Disable all the interrupts just in case */
 	sifive_spi_write(spi, SIFIVE_SPI_REG_IE, 0);
 	clk_disable_unprepare(spi->clk);
-
-	return 0;
 }
 
 static int sifive_spi_suspend(struct device *dev)
@@ -473,7 +471,7 @@ MODULE_DEVICE_TABLE(of, sifive_spi_of_match);
 
 static struct platform_driver sifive_spi_driver = {
 	.probe = sifive_spi_probe,
-	.remove = sifive_spi_remove,
+	.remove_new = sifive_spi_remove,
 	.driver = {
 		.name = SIFIVE_SPI_DRIVER_NAME,
 		.pm = &sifive_spi_pm_ops,
-- 
2.39.1


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

* [PATCH 68/87] spi: slave-mt27xx: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (66 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 67/87] spi: sifive: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 69/87] spi: sn-f-ospi: " Uwe Kleine-König
                   ` (21 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Matthias Brugger
  Cc: AngeloGioacchino Del Regno, linux-spi, 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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-slave-mt27xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-slave-mt27xx.c b/drivers/spi/spi-slave-mt27xx.c
index f199a6c4738a..4e4d426bfb43 100644
--- a/drivers/spi/spi-slave-mt27xx.c
+++ b/drivers/spi/spi-slave-mt27xx.c
@@ -474,11 +474,9 @@ static int mtk_spi_slave_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mtk_spi_slave_remove(struct platform_device *pdev)
+static void mtk_spi_slave_remove(struct platform_device *pdev)
 {
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -560,7 +558,7 @@ static struct platform_driver mtk_spi_slave_driver = {
 		.of_match_table = mtk_spi_slave_of_match,
 	},
 	.probe = mtk_spi_slave_probe,
-	.remove = mtk_spi_slave_remove,
+	.remove_new = mtk_spi_slave_remove,
 };
 
 module_platform_driver(mtk_spi_slave_driver);
-- 
2.39.1


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

* [PATCH 69/87] spi: sn-f-ospi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (67 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 68/87] spi: slave-mt27xx: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 70/87] spi: sprd-adi: " Uwe Kleine-König
                   ` (20 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-sn-f-ospi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-sn-f-ospi.c b/drivers/spi/spi-sn-f-ospi.c
index 333b22dfd8db..644ae34f623b 100644
--- a/drivers/spi/spi-sn-f-ospi.c
+++ b/drivers/spi/spi-sn-f-ospi.c
@@ -670,15 +670,13 @@ static int f_ospi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int f_ospi_remove(struct platform_device *pdev)
+static void f_ospi_remove(struct platform_device *pdev)
 {
 	struct f_ospi *ospi = platform_get_drvdata(pdev);
 
 	clk_disable_unprepare(ospi->clk);
 
 	mutex_destroy(&ospi->mlock);
-
-	return 0;
 }
 
 static const struct of_device_id f_ospi_dt_ids[] = {
@@ -693,7 +691,7 @@ static struct platform_driver f_ospi_driver = {
 		.of_match_table = f_ospi_dt_ids,
 	},
 	.probe = f_ospi_probe,
-	.remove = f_ospi_remove,
+	.remove_new = f_ospi_remove,
 };
 module_platform_driver(f_ospi_driver);
 
-- 
2.39.1


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

* [PATCH 70/87] spi: sprd-adi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (68 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 69/87] spi: sn-f-ospi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 71/87] spi: st-ssc4: " Uwe Kleine-König
                   ` (19 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Orson Zhai, Baolin Wang, Chunyan Zhang; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-sprd-adi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c
index 1edbf44c05a7..3b158124d79f 100644
--- a/drivers/spi/spi-sprd-adi.c
+++ b/drivers/spi/spi-sprd-adi.c
@@ -608,13 +608,12 @@ static int sprd_adi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sprd_adi_remove(struct platform_device *pdev)
+static void sprd_adi_remove(struct platform_device *pdev)
 {
 	struct spi_controller *ctlr = dev_get_drvdata(&pdev->dev);
 	struct sprd_adi *sadi = spi_controller_get_devdata(ctlr);
 
 	unregister_restart_handler(&sadi->restart_handler);
-	return 0;
 }
 
 static struct sprd_adi_data sc9860_data = {
@@ -660,7 +659,7 @@ static struct platform_driver sprd_adi_driver = {
 		.of_match_table = sprd_adi_of_match,
 	},
 	.probe = sprd_adi_probe,
-	.remove = sprd_adi_remove,
+	.remove_new = sprd_adi_remove,
 };
 module_platform_driver(sprd_adi_driver);
 
-- 
2.39.1


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

* [PATCH 71/87] spi: st-ssc4: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (69 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 70/87] spi: sprd-adi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 72/87] spi: stm32-qspi: " Uwe Kleine-König
                   ` (18 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-st-ssc4.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c
index 843be803696b..9141f19c7f8e 100644
--- a/drivers/spi/spi-st-ssc4.c
+++ b/drivers/spi/spi-st-ssc4.c
@@ -366,7 +366,7 @@ static int spi_st_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int spi_st_remove(struct platform_device *pdev)
+static void spi_st_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct spi_st *spi_st = spi_master_get_devdata(master);
@@ -376,8 +376,6 @@ static int spi_st_remove(struct platform_device *pdev)
 	clk_disable_unprepare(spi_st->clk);
 
 	pinctrl_pm_select_sleep_state(&pdev->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -451,7 +449,7 @@ static struct platform_driver spi_st_driver = {
 		.of_match_table = of_match_ptr(stm_spi_match),
 	},
 	.probe = spi_st_probe,
-	.remove = spi_st_remove,
+	.remove_new = spi_st_remove,
 };
 module_platform_driver(spi_st_driver);
 
-- 
2.39.1


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

* [PATCH 72/87] spi: stm32-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (70 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 71/87] spi: st-ssc4: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 73/87] spi: stm32: " Uwe Kleine-König
                   ` (17 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Maxime Coquelin, Alexandre Torgue
  Cc: linux-spi, linux-stm32, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-stm32-qspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c
index 9131660c1afb..29125af0afdb 100644
--- a/drivers/spi/spi-stm32-qspi.c
+++ b/drivers/spi/spi-stm32-qspi.c
@@ -888,7 +888,7 @@ static int stm32_qspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int stm32_qspi_remove(struct platform_device *pdev)
+static void stm32_qspi_remove(struct platform_device *pdev)
 {
 	struct stm32_qspi *qspi = platform_get_drvdata(pdev);
 
@@ -903,8 +903,6 @@ static int stm32_qspi_remove(struct platform_device *pdev)
 	pm_runtime_set_suspended(qspi->dev);
 	pm_runtime_dont_use_autosuspend(qspi->dev);
 	clk_disable_unprepare(qspi->clk);
-
-	return 0;
 }
 
 static int __maybe_unused stm32_qspi_runtime_suspend(struct device *dev)
@@ -968,7 +966,7 @@ MODULE_DEVICE_TABLE(of, stm32_qspi_match);
 
 static struct platform_driver stm32_qspi_driver = {
 	.probe	= stm32_qspi_probe,
-	.remove	= stm32_qspi_remove,
+	.remove_new = stm32_qspi_remove,
 	.driver	= {
 		.name = "stm32-qspi",
 		.of_match_table = stm32_qspi_match,
-- 
2.39.1


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

* [PATCH 73/87] spi: stm32: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (71 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 72/87] spi: stm32-qspi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 74/87] spi: sun4i: " Uwe Kleine-König
                   ` (16 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Alain Volmat, Mark Brown, Maxime Coquelin, Alexandre Torgue
  Cc: linux-spi, linux-stm32, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-stm32.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index def09cf0dc14..9ccb52296e57 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -1922,7 +1922,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int stm32_spi_remove(struct platform_device *pdev)
+static void stm32_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct stm32_spi *spi = spi_master_get_devdata(master);
@@ -1946,8 +1946,6 @@ static int stm32_spi_remove(struct platform_device *pdev)
 
 
 	pinctrl_pm_select_sleep_state(&pdev->dev);
-
-	return 0;
 }
 
 static int __maybe_unused stm32_spi_runtime_suspend(struct device *dev)
@@ -2023,7 +2021,7 @@ static const struct dev_pm_ops stm32_spi_pm_ops = {
 
 static struct platform_driver stm32_spi_driver = {
 	.probe = stm32_spi_probe,
-	.remove = stm32_spi_remove,
+	.remove_new = stm32_spi_remove,
 	.driver = {
 		.name = DRIVER_NAME,
 		.pm = &stm32_spi_pm_ops,
-- 
2.39.1


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

* [PATCH 74/87] spi: sun4i: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (72 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 73/87] spi: stm32: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:29   ` Andre Przywara
  2023-03-14 20:11   ` Jernej Škrabec
  2023-03-03 17:20 ` [PATCH 75/87] spi: sun6i: " Uwe Kleine-König
                   ` (15 subsequent siblings)
  89 siblings, 2 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: linux-spi, 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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-sun4i.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index 6000d0761206..994d0fb50e68 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -516,11 +516,9 @@ static int sun4i_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sun4i_spi_remove(struct platform_device *pdev)
+static void sun4i_spi_remove(struct platform_device *pdev)
 {
 	pm_runtime_force_suspend(&pdev->dev);
-
-	return 0;
 }
 
 static const struct of_device_id sun4i_spi_match[] = {
@@ -536,7 +534,7 @@ static const struct dev_pm_ops sun4i_spi_pm_ops = {
 
 static struct platform_driver sun4i_spi_driver = {
 	.probe	= sun4i_spi_probe,
-	.remove	= sun4i_spi_remove,
+	.remove_new = sun4i_spi_remove,
 	.driver	= {
 		.name		= "sun4i-spi",
 		.of_match_table	= sun4i_spi_match,
-- 
2.39.1


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

* [PATCH 75/87] spi: sun6i: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (73 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 74/87] spi: sun4i: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:30   ` Andre Przywara
  2023-03-14 20:12   ` Jernej Škrabec
  2023-03-03 17:20 ` [PATCH 76/87] spi: sunplus-sp7021: " Uwe Kleine-König
                   ` (14 subsequent siblings)
  89 siblings, 2 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: linux-spi, 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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-sun6i.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c
index 23ad052528db..43c29afea6bb 100644
--- a/drivers/spi/spi-sun6i.c
+++ b/drivers/spi/spi-sun6i.c
@@ -683,7 +683,7 @@ static int sun6i_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sun6i_spi_remove(struct platform_device *pdev)
+static void sun6i_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 
@@ -693,7 +693,6 @@ static int sun6i_spi_remove(struct platform_device *pdev)
 		dma_release_channel(master->dma_tx);
 	if (master->dma_rx)
 		dma_release_channel(master->dma_rx);
-	return 0;
 }
 
 static const struct of_device_id sun6i_spi_match[] = {
@@ -710,7 +709,7 @@ static const struct dev_pm_ops sun6i_spi_pm_ops = {
 
 static struct platform_driver sun6i_spi_driver = {
 	.probe	= sun6i_spi_probe,
-	.remove	= sun6i_spi_remove,
+	.remove_new = sun6i_spi_remove,
 	.driver	= {
 		.name		= "sun6i-spi",
 		.of_match_table	= sun6i_spi_match,
-- 
2.39.1


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

* [PATCH 76/87] spi: sunplus-sp7021: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (74 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 75/87] spi: sun6i: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 77/87] spi: synquacer: " Uwe Kleine-König
                   ` (13 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Li-hao Kuo, Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-sunplus-sp7021.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-sunplus-sp7021.c b/drivers/spi/spi-sunplus-sp7021.c
index f1fa88777575..eb8f835a4771 100644
--- a/drivers/spi/spi-sunplus-sp7021.c
+++ b/drivers/spi/spi-sunplus-sp7021.c
@@ -504,14 +504,13 @@ static int sp7021_spi_controller_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int sp7021_spi_controller_remove(struct platform_device *pdev)
+static void sp7021_spi_controller_remove(struct platform_device *pdev)
 {
 	struct spi_controller *ctlr = dev_get_drvdata(&pdev->dev);
 
 	spi_unregister_controller(ctlr);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_set_suspended(&pdev->dev);
-	return 0;
 }
 
 static int __maybe_unused sp7021_spi_controller_suspend(struct device *dev)
@@ -564,7 +563,7 @@ MODULE_DEVICE_TABLE(of, sp7021_spi_controller_ids);
 
 static struct platform_driver sp7021_spi_controller_driver = {
 	.probe = sp7021_spi_controller_probe,
-	.remove = sp7021_spi_controller_remove,
+	.remove_new = sp7021_spi_controller_remove,
 	.driver = {
 		.name = "sunplus,sp7021-spi-controller",
 		.of_match_table = sp7021_spi_controller_ids,
-- 
2.39.1


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

* [PATCH 77/87] spi: synquacer: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (75 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 76/87] spi: sunplus-sp7021: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 78/87] spi: tegra114: " Uwe Kleine-König
                   ` (12 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Masahisa Kojima, Jassi Brar, Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-synquacer.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-synquacer.c b/drivers/spi/spi-synquacer.c
index dc188f9202c9..3a92f722a6c5 100644
--- a/drivers/spi/spi-synquacer.c
+++ b/drivers/spi/spi-synquacer.c
@@ -735,7 +735,7 @@ static int synquacer_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int synquacer_spi_remove(struct platform_device *pdev)
+static void synquacer_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct synquacer_spi *sspi = spi_master_get_devdata(master);
@@ -743,8 +743,6 @@ static int synquacer_spi_remove(struct platform_device *pdev)
 	pm_runtime_disable(sspi->dev);
 
 	clk_disable_unprepare(sspi->clk);
-
-	return 0;
 }
 
 static int __maybe_unused synquacer_spi_suspend(struct device *dev)
@@ -820,7 +818,7 @@ static struct platform_driver synquacer_spi_driver = {
 		.acpi_match_table = ACPI_PTR(synquacer_hsspi_acpi_ids),
 	},
 	.probe = synquacer_spi_probe,
-	.remove = synquacer_spi_remove,
+	.remove_new = synquacer_spi_remove,
 };
 module_platform_driver(synquacer_spi_driver);
 
-- 
2.39.1


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

* [PATCH 78/87] spi: tegra114: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (76 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 77/87] spi: synquacer: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 79/87] spi: tegra20-sflash: " Uwe Kleine-König
                   ` (11 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter
  Cc: linux-spi, linux-tegra, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-tegra114.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index d9be80e3e1bc..b6bee922a92c 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -1440,7 +1440,7 @@ static int tegra_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tegra_spi_remove(struct platform_device *pdev)
+static void tegra_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct tegra_spi_data	*tspi = spi_master_get_devdata(master);
@@ -1456,8 +1456,6 @@ static int tegra_spi_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 	if (!pm_runtime_status_suspended(&pdev->dev))
 		tegra_spi_runtime_suspend(&pdev->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -1526,7 +1524,7 @@ static struct platform_driver tegra_spi_driver = {
 		.of_match_table	= tegra_spi_of_match,
 	},
 	.probe =	tegra_spi_probe,
-	.remove =	tegra_spi_remove,
+	.remove_new =	tegra_spi_remove,
 };
 module_platform_driver(tegra_spi_driver);
 
-- 
2.39.1


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

* [PATCH 79/87] spi: tegra20-sflash: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (77 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 78/87] spi: tegra114: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 80/87] spi: tegra20-slink: " Uwe Kleine-König
                   ` (10 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter
  Cc: linux-spi, linux-tegra, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-tegra20-sflash.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
index 220ee08c4a06..ed82530ea64b 100644
--- a/drivers/spi/spi-tegra20-sflash.c
+++ b/drivers/spi/spi-tegra20-sflash.c
@@ -520,7 +520,7 @@ static int tegra_sflash_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tegra_sflash_remove(struct platform_device *pdev)
+static void tegra_sflash_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct tegra_sflash_data	*tsd = spi_master_get_devdata(master);
@@ -530,8 +530,6 @@ static int tegra_sflash_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 	if (!pm_runtime_status_suspended(&pdev->dev))
 		tegra_sflash_runtime_suspend(&pdev->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -598,7 +596,7 @@ static struct platform_driver tegra_sflash_driver = {
 		.of_match_table	= tegra_sflash_of_match,
 	},
 	.probe =	tegra_sflash_probe,
-	.remove =	tegra_sflash_remove,
+	.remove_new =	tegra_sflash_remove,
 };
 module_platform_driver(tegra_sflash_driver);
 
-- 
2.39.1


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

* [PATCH 80/87] spi: tegra20-slink: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (78 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 79/87] spi: tegra20-sflash: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 81/87] spi: tegra210-quad: " Uwe Kleine-König
                   ` (9 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter
  Cc: linux-spi, linux-tegra, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-tegra20-slink.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index 148043d0c2b8..ac7933bc03e2 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -1134,7 +1134,7 @@ static int tegra_slink_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tegra_slink_remove(struct platform_device *pdev)
+static void tegra_slink_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
 	struct tegra_slink_data	*tspi = spi_master_get_devdata(master);
@@ -1152,7 +1152,6 @@ static int tegra_slink_remove(struct platform_device *pdev)
 		tegra_slink_deinit_dma_param(tspi, true);
 
 	spi_master_put(master);
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -1220,7 +1219,7 @@ static struct platform_driver tegra_slink_driver = {
 		.of_match_table	= tegra_slink_of_match,
 	},
 	.probe =	tegra_slink_probe,
-	.remove =	tegra_slink_remove,
+	.remove_new =	tegra_slink_remove,
 };
 module_platform_driver(tegra_slink_driver);
 
-- 
2.39.1


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

* [PATCH 81/87] spi: tegra210-quad: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (79 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 80/87] spi: tegra20-slink: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 82/87] spi: topcliff-pch: " Uwe Kleine-König
                   ` (8 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Laxman Dewangan, Thierry Reding, Jonathan Hunter,
	Sowjanya Komatineni, Mark Brown
  Cc: linux-tegra, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-tegra210-quad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index 0b9bc3b7f53a..fd0d532364e2 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -1630,7 +1630,7 @@ static int tegra_qspi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tegra_qspi_remove(struct platform_device *pdev)
+static void tegra_qspi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct tegra_qspi *tqspi = spi_master_get_devdata(master);
@@ -1639,8 +1639,6 @@ static int tegra_qspi_remove(struct platform_device *pdev)
 	free_irq(tqspi->irq, tqspi);
 	pm_runtime_force_suspend(&pdev->dev);
 	tegra_qspi_deinit_dma(tqspi);
-
-	return 0;
 }
 
 static int __maybe_unused tegra_qspi_suspend(struct device *dev)
@@ -1714,7 +1712,7 @@ static struct platform_driver tegra_qspi_driver = {
 		.acpi_match_table = ACPI_PTR(tegra_qspi_acpi_match),
 	},
 	.probe =	tegra_qspi_probe,
-	.remove =	tegra_qspi_remove,
+	.remove_new =	tegra_qspi_remove,
 };
 module_platform_driver(tegra_qspi_driver);
 
-- 
2.39.1


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

* [PATCH 82/87] spi: topcliff-pch: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (80 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 81/87] spi: tegra210-quad: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 83/87] spi: uniphier: " Uwe Kleine-König
                   ` (7 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-topcliff-pch.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index cbb60198a7f0..1679a0ba3d62 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -1396,7 +1396,7 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev)
 	return ret;
 }
 
-static int pch_spi_pd_remove(struct platform_device *plat_dev)
+static void pch_spi_pd_remove(struct platform_device *plat_dev)
 {
 	struct pch_spi_board_data *board_dat = dev_get_platdata(&plat_dev->dev);
 	struct pch_spi_data *data = platform_get_drvdata(plat_dev);
@@ -1434,8 +1434,6 @@ static int pch_spi_pd_remove(struct platform_device *plat_dev)
 
 	pci_iounmap(board_dat->pdev, data->io_remap_addr);
 	spi_unregister_master(data->master);
-
-	return 0;
 }
 #ifdef CONFIG_PM
 static int pch_spi_pd_suspend(struct platform_device *pd_dev,
@@ -1516,7 +1514,7 @@ static struct platform_driver pch_spi_pd_driver = {
 		.name = "pch-spi",
 	},
 	.probe = pch_spi_pd_probe,
-	.remove = pch_spi_pd_remove,
+	.remove_new = pch_spi_pd_remove,
 	.suspend = pch_spi_pd_suspend,
 	.resume = pch_spi_pd_resume
 };
-- 
2.39.1


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

* [PATCH 83/87] spi: uniphier: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (81 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 82/87] spi: topcliff-pch: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 84/87] spi: xilinx: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Kunihiko Hayashi, Masami Hiramatsu
  Cc: linux-spi, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-uniphier.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c
index cc0da4822231..f5344527af0b 100644
--- a/drivers/spi/spi-uniphier.c
+++ b/drivers/spi/spi-uniphier.c
@@ -775,7 +775,7 @@ static int uniphier_spi_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int uniphier_spi_remove(struct platform_device *pdev)
+static void uniphier_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct uniphier_spi_priv *priv = spi_master_get_devdata(master);
@@ -786,8 +786,6 @@ static int uniphier_spi_remove(struct platform_device *pdev)
 		dma_release_channel(master->dma_rx);
 
 	clk_disable_unprepare(priv->clk);
-
-	return 0;
 }
 
 static const struct of_device_id uniphier_spi_match[] = {
@@ -798,7 +796,7 @@ MODULE_DEVICE_TABLE(of, uniphier_spi_match);
 
 static struct platform_driver uniphier_spi_driver = {
 	.probe = uniphier_spi_probe,
-	.remove = uniphier_spi_remove,
+	.remove_new = uniphier_spi_remove,
 	.driver = {
 		.name = "uniphier-spi",
 		.of_match_table = uniphier_spi_match,
-- 
2.39.1


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

* [PATCH 84/87] spi: xilinx: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (82 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 83/87] spi: uniphier: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 85/87] spi: xtensa-xtfpga: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Michal Simek; +Cc: linux-spi, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-xilinx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index 1411548f4255..d2f9eea5e093 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -504,7 +504,7 @@ static int xilinx_spi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int xilinx_spi_remove(struct platform_device *pdev)
+static void xilinx_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct xilinx_spi *xspi = spi_master_get_devdata(master);
@@ -518,8 +518,6 @@ static int xilinx_spi_remove(struct platform_device *pdev)
 	xspi->write_fn(0, regs_base + XIPIF_V123B_DGIER_OFFSET);
 
 	spi_master_put(xspi->bitbang.master);
-
-	return 0;
 }
 
 /* work with hotplug and coldplug */
@@ -527,7 +525,7 @@ MODULE_ALIAS("platform:" XILINX_SPI_NAME);
 
 static struct platform_driver xilinx_spi_driver = {
 	.probe = xilinx_spi_probe,
-	.remove = xilinx_spi_remove,
+	.remove_new = xilinx_spi_remove,
 	.driver = {
 		.name = XILINX_SPI_NAME,
 		.of_match_table = xilinx_spi_of_match,
-- 
2.39.1


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

* [PATCH 85/87] spi: xtensa-xtfpga: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (83 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 84/87] spi: xilinx: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 86/87] spi: zynq-qspi: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Max Filippov, Mark Brown; +Cc: linux-xtensa, linux-spi, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-xtensa-xtfpga.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-xtensa-xtfpga.c b/drivers/spi/spi-xtensa-xtfpga.c
index 2fa7608f94cd..24dc845b940e 100644
--- a/drivers/spi/spi-xtensa-xtfpga.c
+++ b/drivers/spi/spi-xtensa-xtfpga.c
@@ -117,15 +117,13 @@ static int xtfpga_spi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int xtfpga_spi_remove(struct platform_device *pdev)
+static void xtfpga_spi_remove(struct platform_device *pdev)
 {
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct xtfpga_spi *xspi = spi_master_get_devdata(master);
 
 	spi_bitbang_stop(&xspi->bitbang);
 	spi_master_put(master);
-
-	return 0;
 }
 
 MODULE_ALIAS("platform:" XTFPGA_SPI_NAME);
@@ -140,7 +138,7 @@ MODULE_DEVICE_TABLE(of, xtfpga_spi_of_match);
 
 static struct platform_driver xtfpga_spi_driver = {
 	.probe = xtfpga_spi_probe,
-	.remove = xtfpga_spi_remove,
+	.remove_new = xtfpga_spi_remove,
 	.driver = {
 		.name = XTFPGA_SPI_NAME,
 		.of_match_table = of_match_ptr(xtfpga_spi_of_match),
-- 
2.39.1


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

* [PATCH 86/87] spi: zynq-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (84 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 85/87] spi: xtensa-xtfpga: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 17:20 ` [PATCH 87/87] spi: zynqmp-gqspi: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Michal Simek; +Cc: linux-spi, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-zynq-qspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c
index 78f31b61a2aa..8558c0fe3775 100644
--- a/drivers/spi/spi-zynq-qspi.c
+++ b/drivers/spi/spi-zynq-qspi.c
@@ -741,7 +741,7 @@ static int zynq_qspi_probe(struct platform_device *pdev)
  *
  * Return:	0 on success and error value on failure
  */
-static int zynq_qspi_remove(struct platform_device *pdev)
+static void zynq_qspi_remove(struct platform_device *pdev)
 {
 	struct zynq_qspi *xqspi = platform_get_drvdata(pdev);
 
@@ -749,8 +749,6 @@ static int zynq_qspi_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(xqspi->refclk);
 	clk_disable_unprepare(xqspi->pclk);
-
-	return 0;
 }
 
 static const struct of_device_id zynq_qspi_of_match[] = {
@@ -765,7 +763,7 @@ MODULE_DEVICE_TABLE(of, zynq_qspi_of_match);
  */
 static struct platform_driver zynq_qspi_driver = {
 	.probe = zynq_qspi_probe,
-	.remove = zynq_qspi_remove,
+	.remove_new = zynq_qspi_remove,
 	.driver = {
 		.name = "zynq-qspi",
 		.of_match_table = zynq_qspi_of_match,
-- 
2.39.1


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

* [PATCH 87/87] spi: zynqmp-gqspi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (85 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 86/87] spi: zynq-qspi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
  2023-03-03 18:39 ` [PATCH 00/87] spi: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
  To: Mark Brown, Michal Simek; +Cc: linux-spi, linux-arm-kernel, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/spi-zynqmp-gqspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
index 95ff15665d44..270d28a3f8eb 100644
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -1364,7 +1364,7 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
  *
  * Return:	0 Always
  */
-static int zynqmp_qspi_remove(struct platform_device *pdev)
+static void zynqmp_qspi_remove(struct platform_device *pdev)
 {
 	struct zynqmp_qspi *xqspi = platform_get_drvdata(pdev);
 
@@ -1373,15 +1373,13 @@ static int zynqmp_qspi_remove(struct platform_device *pdev)
 	clk_disable_unprepare(xqspi->pclk);
 	pm_runtime_set_suspended(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 MODULE_DEVICE_TABLE(of, zynqmp_qspi_of_match);
 
 static struct platform_driver zynqmp_qspi_driver = {
 	.probe = zynqmp_qspi_probe,
-	.remove = zynqmp_qspi_remove,
+	.remove_new = zynqmp_qspi_remove,
 	.driver = {
 		.name = "zynqmp-qspi",
 		.of_match_table = zynqmp_qspi_of_match,
-- 
2.39.1


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

* Re: [PATCH 09/87] spi: bcm2835: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 09/87] spi: bcm2835: " Uwe Kleine-König
@ 2023-03-03 17:23   ` Florian Fainelli
  2023-03-06  7:04   ` Uwe Kleine-König
  1 sibling, 0 replies; 115+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:23 UTC (permalink / raw)
  To: Uwe Kleine-König, Mark Brown, Ray Jui, Scott Branden
  Cc: Broadcom internal kernel review list, linux-spi,
	linux-rpi-kernel, linux-arm-kernel, kernel

On 3/3/23 09:19, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian


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

* Re: [PATCH 10/87] spi: bcm2835aux: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 10/87] spi: bcm2835aux: " Uwe Kleine-König
@ 2023-03-03 17:23   ` Florian Fainelli
  0 siblings, 0 replies; 115+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:23 UTC (permalink / raw)
  To: Uwe Kleine-König, Mark Brown, Ray Jui, Scott Branden
  Cc: Broadcom internal kernel review list, linux-spi,
	linux-rpi-kernel, linux-arm-kernel, kernel

On 3/3/23 09:19, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian


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

* Re: [PATCH 13/87] spi: bcmbca-hsspi: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 13/87] spi: bcmbca-hsspi: " Uwe Kleine-König
@ 2023-03-03 17:24   ` Florian Fainelli
  0 siblings, 0 replies; 115+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:24 UTC (permalink / raw)
  To: Uwe Kleine-König, William Zhang, Kursad Oney, Jonas Gorski,
	Mark Brown, Anand Gore, Rafał Miłecki
  Cc: Broadcom internal kernel review list, linux-spi,
	linux-arm-kernel, kernel

On 3/3/23 09:19, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian


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

* Re: [PATCH 14/87] spi: brcmstb-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 14/87] spi: brcmstb-qspi: " Uwe Kleine-König
@ 2023-03-03 17:24   ` Florian Fainelli
  0 siblings, 0 replies; 115+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:24 UTC (permalink / raw)
  To: Uwe Kleine-König, Kamal Dasu, Mark Brown
  Cc: Broadcom internal kernel review list, linux-spi,
	linux-arm-kernel, kernel

On 3/3/23 09:19, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian


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

* Re: [PATCH 11/87] spi: bcm63xx-hsspi: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 11/87] spi: bcm63xx-hsspi: " Uwe Kleine-König
@ 2023-03-03 17:26   ` Florian Fainelli
  0 siblings, 0 replies; 115+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:26 UTC (permalink / raw)
  To: Uwe Kleine-König, William Zhang, Kursad Oney, Jonas Gorski,
	Mark Brown
  Cc: Broadcom internal kernel review list, linux-spi, kernel

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

On 3/3/23 09:19, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

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

* Re: [PATCH 32/87] spi: iproc-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 32/87] spi: iproc-qspi: " Uwe Kleine-König
@ 2023-03-03 17:26   ` Florian Fainelli
  0 siblings, 0 replies; 115+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:26 UTC (permalink / raw)
  To: Uwe Kleine-König, Kamal Dasu, Mark Brown, Ray Jui, Scott Branden
  Cc: Broadcom internal kernel review list, linux-spi,
	linux-arm-kernel, kernel

On 3/3/23 09:19, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian


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

* Re: [PATCH 74/87] spi: sun4i: Convert to platform remove callback returning void
  2023-03-03 17:20 ` [PATCH 74/87] spi: sun4i: " Uwe Kleine-König
@ 2023-03-03 17:29   ` Andre Przywara
  2023-03-14 20:11   ` Jernej Škrabec
  1 sibling, 0 replies; 115+ messages in thread
From: Andre Przywara @ 2023-03-03 17:29 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Mark Brown, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	linux-spi, linux-arm-kernel, linux-sunxi, kernel

On Fri,  3 Mar 2023 18:20:28 +0100
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:

> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
>  drivers/spi/spi-sun4i.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
> index 6000d0761206..994d0fb50e68 100644
> --- a/drivers/spi/spi-sun4i.c
> +++ b/drivers/spi/spi-sun4i.c
> @@ -516,11 +516,9 @@ static int sun4i_spi_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int sun4i_spi_remove(struct platform_device *pdev)
> +static void sun4i_spi_remove(struct platform_device *pdev)
>  {
>  	pm_runtime_force_suspend(&pdev->dev);
> -
> -	return 0;
>  }
>  
>  static const struct of_device_id sun4i_spi_match[] = {
> @@ -536,7 +534,7 @@ static const struct dev_pm_ops sun4i_spi_pm_ops = {
>  
>  static struct platform_driver sun4i_spi_driver = {
>  	.probe	= sun4i_spi_probe,
> -	.remove	= sun4i_spi_remove,
> +	.remove_new = sun4i_spi_remove,
>  	.driver	= {
>  		.name		= "sun4i-spi",
>  		.of_match_table	= sun4i_spi_match,


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

* Re: [PATCH 75/87] spi: sun6i: Convert to platform remove callback returning void
  2023-03-03 17:20 ` [PATCH 75/87] spi: sun6i: " Uwe Kleine-König
@ 2023-03-03 17:30   ` Andre Przywara
  2023-03-14 20:12   ` Jernej Škrabec
  1 sibling, 0 replies; 115+ messages in thread
From: Andre Przywara @ 2023-03-03 17:30 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Mark Brown, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	linux-spi, linux-arm-kernel, linux-sunxi, kernel

On Fri,  3 Mar 2023 18:20:29 +0100
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:

> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
>  drivers/spi/spi-sun6i.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c
> index 23ad052528db..43c29afea6bb 100644
> --- a/drivers/spi/spi-sun6i.c
> +++ b/drivers/spi/spi-sun6i.c
> @@ -683,7 +683,7 @@ static int sun6i_spi_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int sun6i_spi_remove(struct platform_device *pdev)
> +static void sun6i_spi_remove(struct platform_device *pdev)
>  {
>  	struct spi_master *master = platform_get_drvdata(pdev);
>  
> @@ -693,7 +693,6 @@ static int sun6i_spi_remove(struct platform_device *pdev)
>  		dma_release_channel(master->dma_tx);
>  	if (master->dma_rx)
>  		dma_release_channel(master->dma_rx);
> -	return 0;
>  }
>  
>  static const struct of_device_id sun6i_spi_match[] = {
> @@ -710,7 +709,7 @@ static const struct dev_pm_ops sun6i_spi_pm_ops = {
>  
>  static struct platform_driver sun6i_spi_driver = {
>  	.probe	= sun6i_spi_probe,
> -	.remove	= sun6i_spi_remove,
> +	.remove_new = sun6i_spi_remove,
>  	.driver	= {
>  		.name		= "sun6i-spi",
>  		.of_match_table	= sun6i_spi_match,


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

* Re: [PATCH 37/87] spi: microchip-core: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 37/87] spi: microchip-core: " Uwe Kleine-König
@ 2023-03-03 17:44   ` Conor Dooley
  0 siblings, 0 replies; 115+ messages in thread
From: Conor Dooley @ 2023-03-03 17:44 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Conor Dooley, Daire McNamara, Mark Brown, linux-riscv, linux-spi, kernel

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

On Fri, Mar 03, 2023 at 06:19:51PM +0100, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

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

Thanks,
Conor.

> ---
>  drivers/spi/spi-microchip-core.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
> index aeaa1da88f39..e6cf6ff08061 100644
> --- a/drivers/spi/spi-microchip-core.c
> +++ b/drivers/spi/spi-microchip-core.c
> @@ -566,7 +566,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int mchp_corespi_remove(struct platform_device *pdev)
> +static void mchp_corespi_remove(struct platform_device *pdev)
>  {
>  	struct spi_master *master  = platform_get_drvdata(pdev);
>  	struct mchp_corespi *spi = spi_master_get_devdata(master);
> @@ -574,8 +574,6 @@ static int mchp_corespi_remove(struct platform_device *pdev)
>  	mchp_corespi_disable_ints(spi);
>  	clk_disable_unprepare(spi->clk);
>  	mchp_corespi_disable(spi);
> -
> -	return 0;
>  }
>  
>  #define MICROCHIP_SPI_PM_OPS (NULL)
> @@ -599,7 +597,7 @@ static struct platform_driver mchp_corespi_driver = {
>  		.pm = MICROCHIP_SPI_PM_OPS,
>  		.of_match_table = of_match_ptr(mchp_corespi_dt_ids),
>  	},
> -	.remove = mchp_corespi_remove,
> +	.remove_new = mchp_corespi_remove,
>  };
>  module_platform_driver(mchp_corespi_driver);
>  MODULE_DESCRIPTION("Microchip coreSPI SPI controller driver");
> -- 
> 2.39.1
> 

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

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

* Re: [PATCH 36/87] spi: microchip-core-qspi: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 36/87] spi: microchip-core-qspi: " Uwe Kleine-König
@ 2023-03-03 17:45   ` Conor Dooley
  0 siblings, 0 replies; 115+ messages in thread
From: Conor Dooley @ 2023-03-03 17:45 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Conor Dooley, Daire McNamara, Mark Brown, linux-riscv, linux-spi, kernel

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

On Fri, Mar 03, 2023 at 06:19:50PM +0100, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

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

Thanks,
Conor.

> ---
>  drivers/spi/spi-microchip-core-qspi.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-microchip-core-qspi.c b/drivers/spi/spi-microchip-core-qspi.c
> index 19a6a46829f6..4f76ddf97b10 100644
> --- a/drivers/spi/spi-microchip-core-qspi.c
> +++ b/drivers/spi/spi-microchip-core-qspi.c
> @@ -566,7 +566,7 @@ static int mchp_coreqspi_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int mchp_coreqspi_remove(struct platform_device *pdev)
> +static void mchp_coreqspi_remove(struct platform_device *pdev)
>  {
>  	struct mchp_coreqspi *qspi = platform_get_drvdata(pdev);
>  	u32 control = readl_relaxed(qspi->regs + REG_CONTROL);
> @@ -575,8 +575,6 @@ static int mchp_coreqspi_remove(struct platform_device *pdev)
>  	control &= ~CONTROL_ENABLE;
>  	writel_relaxed(control, qspi->regs + REG_CONTROL);
>  	clk_disable_unprepare(qspi->clk);
> -
> -	return 0;
>  }
>  
>  static const struct of_device_id mchp_coreqspi_of_match[] = {
> @@ -591,7 +589,7 @@ static struct platform_driver mchp_coreqspi_driver = {
>  		.name = "microchip,coreqspi",
>  		.of_match_table = mchp_coreqspi_of_match,
>  	},
> -	.remove = mchp_coreqspi_remove,
> +	.remove_new = mchp_coreqspi_remove,
>  };
>  module_platform_driver(mchp_coreqspi_driver);
>  
> -- 
> 2.39.1
> 

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

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

* Re: [PATCH 67/87] spi: sifive: Convert to platform remove callback returning void
  2023-03-03 17:20 ` [PATCH 67/87] spi: sifive: " Uwe Kleine-König
@ 2023-03-03 17:46   ` Conor Dooley
  2023-03-03 18:33     ` Uwe Kleine-König
  0 siblings, 1 reply; 115+ messages in thread
From: Conor Dooley @ 2023-03-03 17:46 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Mark Brown, Palmer Dabbelt, Paul Walmsley, linux-spi,
	linux-riscv, kernel

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

On Fri, Mar 03, 2023 at 06:20:21PM +0100, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This one landed in my mailbox too, so:
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
>  drivers/spi/spi-sifive.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-sifive.c b/drivers/spi/spi-sifive.c
> index e29e85cee88a..055de44e0d22 100644
> --- a/drivers/spi/spi-sifive.c
> +++ b/drivers/spi/spi-sifive.c
> @@ -415,7 +415,7 @@ static int sifive_spi_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int sifive_spi_remove(struct platform_device *pdev)
> +static void sifive_spi_remove(struct platform_device *pdev)
>  {
>  	struct spi_master *master = platform_get_drvdata(pdev);
>  	struct sifive_spi *spi = spi_master_get_devdata(master);
> @@ -423,8 +423,6 @@ static int sifive_spi_remove(struct platform_device *pdev)
>  	/* Disable all the interrupts just in case */
>  	sifive_spi_write(spi, SIFIVE_SPI_REG_IE, 0);
>  	clk_disable_unprepare(spi->clk);
> -
> -	return 0;
>  }
>  
>  static int sifive_spi_suspend(struct device *dev)
> @@ -473,7 +471,7 @@ MODULE_DEVICE_TABLE(of, sifive_spi_of_match);
>  
>  static struct platform_driver sifive_spi_driver = {
>  	.probe = sifive_spi_probe,
> -	.remove = sifive_spi_remove,
> +	.remove_new = sifive_spi_remove,
>  	.driver = {
>  		.name = SIFIVE_SPI_DRIVER_NAME,
>  		.pm = &sifive_spi_pm_ops,
> -- 
> 2.39.1
> 

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

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

* Re: [PATCH 67/87] spi: sifive: Convert to platform remove callback returning void
  2023-03-03 17:46   ` Conor Dooley
@ 2023-03-03 18:33     ` Uwe Kleine-König
  0 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 18:33 UTC (permalink / raw)
  To: Conor Dooley
  Cc: linux-spi, Mark Brown, Palmer Dabbelt, kernel, Paul Walmsley,
	linux-riscv

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

Hello Conor,

On Fri, Mar 03, 2023 at 05:46:11PM +0000, Conor Dooley wrote:
> On Fri, Mar 03, 2023 at 06:20:21PM +0100, Uwe Kleine-König wrote:
> > The .remove() callback for a platform driver returns an int which makes
> > many driver authors wrongly assume it's possible to do error handling by
> > returning an error code. However the value returned is (mostly) ignored
> > and this typically results in resource leaks. To improve here there is a
> > quest to make the remove callback return void. In the first step of this
> > quest all drivers are converted to .remove_new() which already returns
> > void.
> > 
> > Trivially convert this driver from always returning zero in the remove
> > callback to the void returning variant.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> This one landed in my mailbox too, so:
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

I have ~2000 of such patches pending in my tree that wait for
submission. If you want a Cc: for each of them, just tell me :-)

Best regards and 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] 115+ messages in thread

* Re: [PATCH 00/87] spi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (86 preceding siblings ...)
  2023-03-03 17:20 ` [PATCH 87/87] spi: zynqmp-gqspi: " Uwe Kleine-König
@ 2023-03-03 18:39 ` Uwe Kleine-König
  2023-03-07 16:47 ` Mark Brown
  2023-03-07 17:00 ` Mark Brown
  89 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 18:39 UTC (permalink / raw)
  To: Mark Brown, Chin-Ting Kuo, Cédric Le Goater, Joel Stanley,
	Radu Pirea, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Tudor Ambarus, Florian Fainelli, Ray Jui, Scott Branden,
	William Zhang, Kursad Oney, Jonas Gorski, Anand Gore,
	Rafał Miłecki, Kamal Dasu, Serge Semin,
	Vladimir Oltean, Han Xu, Andy Gross, Bjorn Andersson, Jay Fang,
	Neil Armstrong, Kevin Hilman, Conor Dooley, Daire McNamara,
	Matthias Brugger, Shawn Guo, Sascha Hauer, Avi Fishman,
	Tomer Maimon, Tali Perry, Haibo Chen, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Heiko Stuebner,
	Krzysztof Kozlowski, Andi Shyti, Palmer Dabbelt, Paul Walmsley,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Maxime Coquelin,
	Alexandre Torgue, Alain Volmat, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Li-hao Kuo, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter,
	Sowjanya Komatineni, Kunihiko Hayashi, Masami Hiramatsu,
	Michal Simek, Max Filippov
  Cc: linux-aspeed, Alim Akhtar, linux-riscv, Fabio Estevam,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Benjamin Fair,
	linux-rockchip, openbmc, Nancy Yuen,
	Broadcom internal kernel review list, NXP Linux Team,
	linux-sunxi, linux-xtensa, Martin Blumenstingl, linux-arm-msm,
	linux-mediatek, linux-rpi-kernel, linux-tegra, linux-amlogic,
	linux-arm-kernel, AngeloGioacchino Del Regno, Andrew Jeffery,
	Patrick Venture, linux-spi, Konrad Dybcio, Yogesh Gaur,
	Pengutronix Kernel Team

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

Hello,

On Fri, Mar 03, 2023 at 06:19:14PM +0100, Uwe Kleine-König wrote:
> this patch series adapts the platform drivers below drivers/spi
> to use the .remove_new() callback. Compared to the traditional .remove()
> callback .remove_new() returns no value. This is a good thing because
> the driver core doesn't (and cannot) cope for errors during remove. The
> only effect of a non-zero return value in .remove() is that the driver
> core emits a warning. The device is removed anyhow and an early return
> from .remove() usually yields a resource leak.
> 
> By changing the remove callback to return void driver authors cannot
> reasonably assume any more that there is some kind of cleanup later.
> 
> All drivers touched here returned zero unconditionally in their remove
> callback, so they could all be converted trivially to .remove_new().

One thing I failed to mention here (because my coccinelle patch to
detect that was suboptimal) is: There are 6 drivers---namely
atmel-quadspi.c, spi-imx.c, spi-mt65xx.c, spi-qup.c, spi-sprd.c, and
spi-ti-qspi.c---that might return a non-zero value in their remove
function. Note that this is exactly the problem that I target to rub out
with the effort to change .remove() to return void.

I'll address them separately.

Best regards
Uwe

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

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

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

* Re: [PATCH 03/87] spi: aspeed-smc: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 03/87] spi: aspeed-smc: " Uwe Kleine-König
@ 2023-03-03 21:52   ` Cédric Le Goater
  0 siblings, 0 replies; 115+ messages in thread
From: Cédric Le Goater @ 2023-03-03 21:52 UTC (permalink / raw)
  To: Uwe Kleine-König, Chin-Ting Kuo, Mark Brown, Joel Stanley
  Cc: Andrew Jeffery, linux-aspeed, openbmc, linux-spi,
	linux-arm-kernel, kernel

On 3/3/23 18:19, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
>   drivers/spi/spi-aspeed-smc.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c
> index 873ff2cf72c9..3f2548860317 100644
> --- a/drivers/spi/spi-aspeed-smc.c
> +++ b/drivers/spi/spi-aspeed-smc.c
> @@ -787,13 +787,12 @@ static int aspeed_spi_probe(struct platform_device *pdev)
>   	return ret;
>   }
>   
> -static int aspeed_spi_remove(struct platform_device *pdev)
> +static void aspeed_spi_remove(struct platform_device *pdev)
>   {
>   	struct aspeed_spi *aspi = platform_get_drvdata(pdev);
>   
>   	aspeed_spi_enable(aspi, false);
>   	clk_disable_unprepare(aspi->clk);
> -	return 0;
>   }
>   
>   /*
> @@ -1201,7 +1200,7 @@ MODULE_DEVICE_TABLE(of, aspeed_spi_matches);
>   
>   static struct platform_driver aspeed_spi_driver = {
>   	.probe			= aspeed_spi_probe,
> -	.remove			= aspeed_spi_remove,
> +	.remove_new		= aspeed_spi_remove,
>   	.driver	= {
>   		.name		= DEVICE_NAME,
>   		.of_match_table = aspeed_spi_matches,


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

* Re: [PATCH 34/87] spi: meson-spicc: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 34/87] spi: meson-spicc: " Uwe Kleine-König
@ 2023-03-04 21:43   ` Martin Blumenstingl
  0 siblings, 0 replies; 115+ messages in thread
From: Martin Blumenstingl @ 2023-03-04 21:43 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Mark Brown, Neil Armstrong, Kevin Hilman, Jerome Brunet,
	linux-spi, linux-arm-kernel, linux-amlogic, kernel

On Fri, Mar 3, 2023 at 6:21 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

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

* Re: [PATCH 35/87] spi: meson-spifc: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 35/87] spi: meson-spifc: " Uwe Kleine-König
@ 2023-03-04 21:43   ` Martin Blumenstingl
  0 siblings, 0 replies; 115+ messages in thread
From: Martin Blumenstingl @ 2023-03-04 21:43 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Mark Brown, Neil Armstrong, Kevin Hilman, Jerome Brunet,
	linux-spi, linux-arm-kernel, linux-amlogic, kernel

On Fri, Mar 3, 2023 at 6:21 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

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

* Re: [PATCH 09/87] spi: bcm2835: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 09/87] spi: bcm2835: " Uwe Kleine-König
  2023-03-03 17:23   ` Florian Fainelli
@ 2023-03-06  7:04   ` Uwe Kleine-König
  2023-03-06 12:26     ` Mark Brown
  1 sibling, 1 reply; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-06  7:04 UTC (permalink / raw)
  To: Mark Brown, Florian Fainelli, Ray Jui, Scott Branden
  Cc: kernel, Broadcom internal kernel review list, linux-rpi-kernel,
	linux-arm-kernel, linux-spi

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

On Fri, Mar 03, 2023 at 06:19:23PM +0100, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/spi/spi-bcm2835.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
> index 747e03228c48..be6050b513a9 100644
> --- a/drivers/spi/spi-bcm2835.c
> +++ b/drivers/spi/spi-bcm2835.c
> @@ -1398,7 +1398,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
>  	return err;
>  }
>  
> -static int bcm2835_spi_remove(struct platform_device *pdev)
> +static void bcm2835_spi_remove(struct platform_device *pdev)
>  {
>  	struct spi_controller *ctlr = platform_get_drvdata(pdev);
>  	struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr);
> @@ -1414,17 +1414,11 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
>  		   BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
>  
>  	clk_disable_unprepare(bs->clk);
> -
> -	return 0;
>  }
>  
>  static void bcm2835_spi_shutdown(struct platform_device *pdev)
>  {
> -	int ret;
> -
> -	ret = bcm2835_spi_remove(pdev);
> -	if (ret)
> -		dev_err(&pdev->dev, "failed to shutdown\n");
> +	rbcm2835_spi_remove(pdev);

The kernel build bot found an issue here. There is an 'r' too
much. i.e. we need:

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index be6050b513a9..29445641fff0 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -1418,7 +1418,7 @@ static void bcm2835_spi_remove(struct platform_device *pdev)
 
 static void bcm2835_spi_shutdown(struct platform_device *pdev)
 {
-	rbcm2835_spi_remove(pdev);
+	bcm2835_spi_remove(pdev);
 }
 
 static const struct of_device_id bcm2835_spi_match[] = {

squashed into the original commit. (I had that uncommitted in my tree
while doing my build tests :-\)

@broonie: how should we proceed here? Is your tree already public and
you need a proper patch to fix this?

Best regards
Uwe

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

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

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

* Re: [PATCH 04/87] spi: at91-usart: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 04/87] spi: at91-usart: " Uwe Kleine-König
@ 2023-03-06 11:57   ` Claudiu.Beznea
  0 siblings, 0 replies; 115+ messages in thread
From: Claudiu.Beznea @ 2023-03-06 11:57 UTC (permalink / raw)
  To: u.kleine-koenig, radu_nicolae.pirea, broonie, Nicolas.Ferre,
	alexandre.belloni
  Cc: linux-spi, linux-arm-kernel, kernel

On 03.03.2023 19:19, Uwe Kleine-König wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

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


> ---
>  drivers/spi/spi-at91-usart.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
> index fab9d223e24a..4fb3653b5941 100644
> --- a/drivers/spi/spi-at91-usart.c
> +++ b/drivers/spi/spi-at91-usart.c
> @@ -647,15 +647,13 @@ __maybe_unused static int at91_usart_spi_resume(struct device *dev)
>         return spi_controller_resume(ctrl);
>  }
> 
> -static int at91_usart_spi_remove(struct platform_device *pdev)
> +static void at91_usart_spi_remove(struct platform_device *pdev)
>  {
>         struct spi_controller *ctlr = platform_get_drvdata(pdev);
>         struct at91_usart_spi *aus = spi_controller_get_devdata(ctlr);
> 
>         at91_usart_spi_release_dma(ctlr);
>         clk_disable_unprepare(aus->clk);
> -
> -       return 0;
>  }
> 
>  static const struct dev_pm_ops at91_usart_spi_pm_ops = {
> @@ -670,7 +668,7 @@ static struct platform_driver at91_usart_spi_driver = {
>                 .pm = &at91_usart_spi_pm_ops,
>         },
>         .probe = at91_usart_spi_probe,
> -       .remove = at91_usart_spi_remove,
> +       .remove_new = at91_usart_spi_remove,
>  };
> 
>  module_platform_driver(at91_usart_spi_driver);
> --
> 2.39.1
> 


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

* Re: [PATCH 06/87] spi: atmel: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 06/87] spi: atmel: " Uwe Kleine-König
@ 2023-03-06 11:57   ` Claudiu.Beznea
  0 siblings, 0 replies; 115+ messages in thread
From: Claudiu.Beznea @ 2023-03-06 11:57 UTC (permalink / raw)
  To: u.kleine-koenig, tudor.ambarus, broonie, Nicolas.Ferre,
	alexandre.belloni
  Cc: linux-spi, linux-arm-kernel, kernel

On 03.03.2023 19:19, Uwe Kleine-König wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

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


> ---
>  drivers/spi/spi-atmel.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 5c5678f065f3..73f80c8ac2ff 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -1596,7 +1596,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
>         return ret;
>  }
> 
> -static int atmel_spi_remove(struct platform_device *pdev)
> +static void atmel_spi_remove(struct platform_device *pdev)
>  {
>         struct spi_controller   *host = platform_get_drvdata(pdev);
>         struct atmel_spi        *as = spi_controller_get_devdata(host);
> @@ -1627,8 +1627,6 @@ static int atmel_spi_remove(struct platform_device *pdev)
> 
>         pm_runtime_put_noidle(&pdev->dev);
>         pm_runtime_disable(&pdev->dev);
> -
> -       return 0;
>  }
> 
>  static int atmel_spi_runtime_suspend(struct device *dev)
> @@ -1712,7 +1710,7 @@ static struct platform_driver atmel_spi_driver = {
>                 .of_match_table = atmel_spi_dt_ids,
>         },
>         .probe          = atmel_spi_probe,
> -       .remove         = atmel_spi_remove,
> +       .remove_new     = atmel_spi_remove,
>  };
>  module_platform_driver(atmel_spi_driver);
> 
> --
> 2.39.1
> 


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

* Re: [PATCH 09/87] spi: bcm2835: Convert to platform remove callback returning void
  2023-03-06  7:04   ` Uwe Kleine-König
@ 2023-03-06 12:26     ` Mark Brown
  0 siblings, 0 replies; 115+ messages in thread
From: Mark Brown @ 2023-03-06 12:26 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Florian Fainelli, Ray Jui, Scott Branden, kernel,
	Broadcom internal kernel review list, linux-rpi-kernel,
	linux-arm-kernel, linux-spi

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

On Mon, Mar 06, 2023 at 08:04:26AM +0100, Uwe Kleine-König wrote:

> squashed into the original commit. (I had that uncommitted in my tree
> while doing my build tests :-\)

> @broonie: how should we proceed here? Is your tree already public and
> you need a proper patch to fix this?

I was just going to drop the commit since it also failed my CI for the
same reason, please send a new replacement.

Please don't add random characters to my name, for whatever reason it's
like you're misspelling it.

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

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

* Re: [PATCH 22/87] spi: dw-mmio: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 22/87] spi: dw-mmio: " Uwe Kleine-König
@ 2023-03-06 15:22   ` Serge Semin
  0 siblings, 0 replies; 115+ messages in thread
From: Serge Semin @ 2023-03-06 15:22 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Mark Brown, linux-spi, kernel

On Fri, Mar 03, 2023 at 06:19:36PM +0100, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.

Thanks!
Acked-by: Serge Semin <fancer.lancer@gmail.com>

-Serge(y)

> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/spi/spi-dw-mmio.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
> index 26c40ea6dd12..6ae124c30969 100644
> --- a/drivers/spi/spi-dw-mmio.c
> +++ b/drivers/spi/spi-dw-mmio.c
> @@ -328,7 +328,7 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int dw_spi_mmio_remove(struct platform_device *pdev)
> +static void dw_spi_mmio_remove(struct platform_device *pdev)
>  {
>  	struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev);
>  
> @@ -337,8 +337,6 @@ static int dw_spi_mmio_remove(struct platform_device *pdev)
>  	clk_disable_unprepare(dwsmmio->pclk);
>  	clk_disable_unprepare(dwsmmio->clk);
>  	reset_control_assert(dwsmmio->rstc);
> -
> -	return 0;
>  }
>  
>  static const struct of_device_id dw_spi_mmio_of_match[] = {
> @@ -366,7 +364,7 @@ MODULE_DEVICE_TABLE(acpi, dw_spi_mmio_acpi_match);
>  
>  static struct platform_driver dw_spi_mmio_driver = {
>  	.probe		= dw_spi_mmio_probe,
> -	.remove		= dw_spi_mmio_remove,
> +	.remove_new	= dw_spi_mmio_remove,
>  	.driver		= {
>  		.name	= DRIVER_NAME,
>  		.of_match_table = dw_spi_mmio_of_match,
> -- 
> 2.39.1
> 

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

* Re: [PATCH 21/87] spi: dw-bt1: Convert to platform remove callback returning void
  2023-03-03 17:19 ` [PATCH 21/87] spi: dw-bt1: " Uwe Kleine-König
@ 2023-03-06 15:22   ` Serge Semin
  0 siblings, 0 replies; 115+ messages in thread
From: Serge Semin @ 2023-03-06 15:22 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Mark Brown, linux-spi, kernel

On Fri, Mar 03, 2023 at 06:19:35PM +0100, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.

Thanks!
Acked-by: Serge Semin <fancer.lancer@gmail.com>

-Serge(y)

> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/spi/spi-dw-bt1.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-dw-bt1.c b/drivers/spi/spi-dw-bt1.c
> index 3fb89dee595e..5e1c01822967 100644
> --- a/drivers/spi/spi-dw-bt1.c
> +++ b/drivers/spi/spi-dw-bt1.c
> @@ -308,7 +308,7 @@ static int dw_spi_bt1_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int dw_spi_bt1_remove(struct platform_device *pdev)
> +static void dw_spi_bt1_remove(struct platform_device *pdev)
>  {
>  	struct dw_spi_bt1 *dwsbt1 = platform_get_drvdata(pdev);
>  
> @@ -317,8 +317,6 @@ static int dw_spi_bt1_remove(struct platform_device *pdev)
>  	pm_runtime_disable(&pdev->dev);
>  
>  	clk_disable_unprepare(dwsbt1->clk);
> -
> -	return 0;
>  }
>  
>  static const struct of_device_id dw_spi_bt1_of_match[] = {
> @@ -330,7 +328,7 @@ MODULE_DEVICE_TABLE(of, dw_spi_bt1_of_match);
>  
>  static struct platform_driver dw_spi_bt1_driver = {
>  	.probe	= dw_spi_bt1_probe,
> -	.remove	= dw_spi_bt1_remove,
> +	.remove_new = dw_spi_bt1_remove,
>  	.driver	= {
>  		.name		= "bt1-sys-ssi",
>  		.of_match_table	= dw_spi_bt1_of_match,
> -- 
> 2.39.1
> 

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

* Re: [PATCH 00/87] spi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (87 preceding siblings ...)
  2023-03-03 18:39 ` [PATCH 00/87] spi: " Uwe Kleine-König
@ 2023-03-07 16:47 ` Mark Brown
  2023-03-07 17:00 ` Mark Brown
  89 siblings, 0 replies; 115+ messages in thread
From: Mark Brown @ 2023-03-07 16:47 UTC (permalink / raw)
  To: Chin-Ting Kuo, Cédric Le Goater, Joel Stanley, Radu Pirea,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Tudor Ambarus,
	Florian Fainelli, Ray Jui, Scott Branden, William Zhang,
	Kursad Oney, Jonas Gorski, Anand Gore, Rafał Miłecki,
	Kamal Dasu, Serge Semin, Vladimir Oltean, Han Xu, Andy Gross,
	Bjorn Andersson, Jay Fang, Neil Armstrong, Kevin Hilman,
	Conor Dooley, Daire McNamara, Matthias Brugger, Shawn Guo,
	Sascha Hauer, Avi Fishman, Tomer Maimon, Tali Perry, Haibo Chen,
	Daniel Mack, Haojian Zhuang, Robert Jarzmik, Heiko Stuebner,
	Krzysztof Kozlowski, Andi Shyti, Palmer Dabbelt, Paul Walmsley,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Maxime Coquelin,
	Alexandre Torgue, Alain Volmat, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Li-hao Kuo, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter,
	Sowjanya Komatineni, Kunihiko Hayashi, Masami Hiramatsu,
	Michal Simek, Max Filippov, Uwe Kleine-König
  Cc: linux-spi, Andrew Jeffery, linux-aspeed, openbmc,
	linux-arm-kernel, Broadcom internal kernel review list,
	linux-rpi-kernel, Konrad Dybcio, linux-arm-msm, Jerome Brunet,
	Martin Blumenstingl, linux-amlogic, linux-riscv,
	AngeloGioacchino Del Regno, linux-mediatek,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Patrick Venture, Nancy Yuen, Benjamin Fair, Yogesh Gaur,
	linux-rockchip, Alim Akhtar, linux-samsung-soc, linux-stm32,
	linux-sunxi, linux-tegra, linux-xtensa

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

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[01/87] spi: ar934x: Convert to platform remove callback returning void
        commit: 24644ae031e71491e729d415d88c3cea98288c39
[02/87] spi: armada-3700: Convert to platform remove callback returning void
        commit: 9a49f22852201e6ba8aafd359e9fc13d32717748
[03/87] spi: aspeed-smc: Convert to platform remove callback returning void
        commit: ebf9a50d13a4406b9831f9e2b35f786a3bb18a3e
[04/87] spi: at91-usart: Convert to platform remove callback returning void
        commit: b9c5544877b03b7d5b3c4c97e9133d0bb695c9cb
[05/87] spi: ath79: Convert to platform remove callback returning void
        commit: 48c42f970b7d0cf034721fe7faf59e5698ad7382
[06/87] spi: atmel: Convert to platform remove callback returning void
        commit: 7412afb044178ac0e6facc5f12b5ab220e06c34c
[07/87] spi: au1550: Convert to platform remove callback returning void
        commit: 02a52038fe42bc4dcb477935d60fc779f9238bda
[08/87] spi: axi-spi-engine: Convert to platform remove callback returning void
        commit: fc87abbef23413943457459e2c473ce607b4dd24
[09/87] spi: bcm2835: Convert to platform remove callback returning void
        (no commit info)
[10/87] spi: bcm2835aux: Convert to platform remove callback returning void
        commit: f3a1c6a016193728a62929e0588e5f640cfe7c34
[11/87] spi: bcm63xx-hsspi: Convert to platform remove callback returning void
        commit: 04cd5f3fad161c27fe101ad7906ddd9085c2b4be
[12/87] spi: bcm63xx: Convert to platform remove callback returning void
        commit: 8c26432e9b5fd04aa59010941051d33fa4e289ba
[13/87] spi: bcmbca-hsspi: Convert to platform remove callback returning void
        commit: f54f9b00c62fb3ee280cd3ad0e4e483c9d401107
[14/87] spi: brcmstb-qspi: Convert to platform remove callback returning void
        commit: c4c34d5ded66204db90acaeaff5af1277ea0c21b
[15/87] spi: cadence-quadspi: Convert to platform remove callback returning void
        commit: 6fe41879e93313afdb18104d20d30783600591fe
[16/87] spi: cadence: Convert to platform remove callback returning void
        commit: 427353015333a1e0d6f61785a2f134c4c382f11f
[17/87] spi: cavium-octeon: Convert to platform remove callback returning void
        commit: f74d4b8b97e39b31ad88f6f679180c0800d57a0c
[18/87] spi: coldfire-qspi: Convert to platform remove callback returning void
        commit: 3f025840b9e9313dbd6479ca9117b1eb827d689f
[19/87] spi: davinci: Convert to platform remove callback returning void
        commit: d1a9fa8a3ece62c62aa8aaa573d8ceea8d8fae69
[20/87] spi: dln2: Convert to platform remove callback returning void
        commit: f8b81e0528b67a86172315aa0b516a5050e89c5d
[21/87] spi: dw-bt1: Convert to platform remove callback returning void
        commit: 42f8295cd7ea680f0e9a5a4d864186736f9f9b24
[22/87] spi: dw-mmio: Convert to platform remove callback returning void
        commit: f74abea25ab2809958c7ce8e29e710c66a490b64
[23/87] spi: ep93xx: Convert to platform remove callback returning void
        commit: bb2714d140913de16bcd59f068b1d7f6dafef964
[24/87] spi: fsl-dspi: Convert to platform remove callback returning void
        commit: 1bcab55f13e1c4d03c20a3d7ea37c4228e7bd41e
[25/87] spi: fsl-espi: Convert to platform remove callback returning void
        commit: de60b184d8dd274f36c7c93f3cefad3904420d00
[26/87] spi: fsl-lpspi: Convert to platform remove callback returning void
        commit: edd49c898751838009940fe38a7ad4c1d23224df
[27/87] spi: fsl-qspi: Convert to platform remove callback returning void
        commit: 94f445096932efc48cac128c8be4e34845a702d6
[28/87] spi: fsl-spi: Convert to platform remove callback returning void
        commit: fc4935a0f7ab1521a5f0500a9894d97558067985
[29/87] spi: geni-qcom: Convert to platform remove callback returning void
        commit: d0b52f6539e008a0d42bf673486bd21b7d2dc191
[30/87] spi: hisi-kunpeng: Convert to platform remove callback returning void
        commit: e77ccdfe0145211b5a20ab62950894aea881bbb3
[31/87] spi: img-spfi: Convert to platform remove callback returning void
        commit: 6b854e44b66ee1b3798eff87f1af8738edeccbde
[32/87] spi: iproc-qspi: Convert to platform remove callback returning void
        commit: a57b08c231ae4240c01b0623053a54cb7ec23194
[33/87] spi: lantiq-ssc: Convert to platform remove callback returning void
        commit: 1f85ed7d4757a24ba5b92fdf2a639002bcc78e95
[34/87] spi: meson-spicc: Convert to platform remove callback returning void
        commit: 8e8355d14187f6a65d9168c7dcfbb916f7fef9a7
[35/87] spi: meson-spifc: Convert to platform remove callback returning void
        commit: a4f5ad1196daf1f6f3329082c95d19adf05bd423
[36/87] spi: microchip-core-qspi: Convert to platform remove callback returning void
        commit: e4cf312d6db2941b8267de6e094312afc1b523ee
[37/87] spi: microchip-core: Convert to platform remove callback returning void
        commit: beb6ed0f8cfa844556ac1f6d494cc9b4f6cb1994
[38/87] spi: mpc512x-psc: Convert to platform remove callback returning void
        (no commit info)
[39/87] spi: mpc52xx-psc: Convert to platform remove callback returning void
        (no commit info)
[40/87] spi: mpc52xx: Convert to platform remove callback returning void
        commit: 3fa689a85df4664a62ea931be31e5276cde1e8fe
[41/87] spi: mtk-nor: Convert to platform remove callback returning void
        commit: b558435810cc68755527e55ccaba6c35c340900a
[42/87] spi: mtk-snfi: Convert to platform remove callback returning void
        commit: 976a689122df6c7d8d826ad36578c0291a1dc214
[43/87] spi: mxic: Convert to platform remove callback returning void
        commit: c64e92dfa0bd1256fc3f9f1a32a5c844e49d8681
[44/87] spi: mxs: Convert to platform remove callback returning void
        commit: a760db097cfdce093c0483343d9f831a33702ad9
[45/87] spi: npcm-fiu: Convert to platform remove callback returning void
        commit: 5e4830adb09a3577eb80c0b8c7611d0c0de02ab8
[46/87] spi: npcm-pspi: Convert to platform remove callback returning void
        commit: 445534b5f25ab8394082b47b50d973676ce54ee4
[47/87] spi: nxp-fspi: Convert to platform remove callback returning void
        commit: 2dd82e32c20b57ad693287b546f775c933670e43
[48/87] spi: oc-tiny: Convert to platform remove callback returning void
        commit: bdffa602d741126896de50307126803ffab7a3de
[49/87] spi: omap-uwire: Convert to platform remove callback returning void
        commit: c43bdb3a1154facd844f6a753b6a30fecaadc16e
[50/87] spi: omap2-mcspi: Convert to platform remove callback returning void
        commit: 0a4192a52082118d0da3bdd34145ebabfde40d93
[51/87] spi: orion: Convert to platform remove callback returning void
        commit: 2e0de1efb233ab8b1a488a6663d31edab9ef0f4f
[52/87] spi: pic32-sqi: Convert to platform remove callback returning void
        commit: 503425ed9c50096a0e0c61f38bc39752f3696266
[53/87] spi: pic32: Convert to platform remove callback returning void
        commit: 01c30f51266acf2595cc06885071e752080ca052
[54/87] spi: ppc4xx: Convert to platform remove callback returning void
        commit: 224d9437eb2967b67ae67c4743bb589f86668e8d
[55/87] spi: pxa2xx: Convert to platform remove callback returning void
        commit: 31f6d96d6807cc1dde70cda36cb45ec61d41fe6b
[56/87] spi: qcom-qspi: Convert to platform remove callback returning void
        commit: e0c30566e5333247bbfdad61f98dccf989ff54e1
[57/87] spi: rb4xx: Convert to platform remove callback returning void
        commit: a006c353a115d429c114e9bc26ab0f6a40d3de23
[58/87] spi: rockchip-sfc: Convert to platform remove callback returning void
        commit: e5fcb34d7934aceb39c7d68d30fbf53d93f1eda6
[59/87] spi: rockchip: Convert to platform remove callback returning void
        commit: 5ff5e676201deca9bcc3c9474842b2f4456f24b8
[60/87] spi: rpc-if: Convert to platform remove callback returning void
        commit: c42ee93aded47fe8cf3615df2e20704c720b7433
[61/87] spi: rspi: Convert to platform remove callback returning void
        commit: 72ec0e8f89a1536e4594606d60a946636ee7d94b
[62/87] spi: s3c64xx: Convert to platform remove callback returning void
        commit: 2b7981a65527a51706b895e170e07b2eaeae69c5
[63/87] spi: sh-hspi: Convert to platform remove callback returning void
        commit: f3a762b613598d198b5ebd5c1fcf6a902f8a9d9f
[64/87] spi: sh-msiof: Convert to platform remove callback returning void
        commit: 74af1328a694d3a2a176935c93db8ad406aacb81
[65/87] spi: sh-sci: Convert to platform remove callback returning void
        commit: 80dc51da19cebaf85b03d910cbf4e56af165b0ff
[66/87] spi: sh: Convert to platform remove callback returning void
        commit: dee2e25572e42faa581b6c86cd1252546680362a
[67/87] spi: sifive: Convert to platform remove callback returning void
        commit: fd8998c4633737310c8165c6c3fc81197380d1d9
[68/87] spi: slave-mt27xx: Convert to platform remove callback returning void
        commit: 1037cfa33cedf733a751c8708d174ba11708ce4a
[69/87] spi: sn-f-ospi: Convert to platform remove callback returning void
        commit: 462414a3d0613cf71ecb3c4fb183698d2441bbb9
[70/87] spi: sprd-adi: Convert to platform remove callback returning void
        commit: f7f785f125d03360d3766d96d04cf08b8472ce8f
[71/87] spi: st-ssc4: Convert to platform remove callback returning void
        commit: 2dd42da0b479ffb4604c81b7c1b30aa9b5f0a4a9
[72/87] spi: stm32-qspi: Convert to platform remove callback returning void
        commit: a19ca20a0e4eccacf44119fccc86c2f3e5edb3f0
[73/87] spi: stm32: Convert to platform remove callback returning void
        commit: 3e11e4f336f603d3cddcc89f94e518391b6a08a5
[74/87] spi: sun4i: Convert to platform remove callback returning void
        commit: b7b949458ac391963e56ae354b73fee63016dcee
[75/87] spi: sun6i: Convert to platform remove callback returning void
        commit: edf69ab9c777abf9ab30c6a5a215d16a094bae87
[76/87] spi: sunplus-sp7021: Convert to platform remove callback returning void
        commit: 18bb7328171203f4ade267bcd7cf5b073a1a9405
[77/87] spi: synquacer: Convert to platform remove callback returning void
        commit: 1972cdc47df737f5b90ac2132080004f5e413e91
[78/87] spi: tegra114: Convert to platform remove callback returning void
        commit: bff9694e97790c7f8c9ff1e979b2af9cb6e69adc
[79/87] spi: tegra20-sflash: Convert to platform remove callback returning void
        commit: 8394b7186cf27be24a75516212d5e76d263397d7
[80/87] spi: tegra20-slink: Convert to platform remove callback returning void
        commit: 7f47f7a2ee28938a7ac104e187ec0bd81b0aecf7
[81/87] spi: tegra210-quad: Convert to platform remove callback returning void
        commit: 001ea026c07dad216e1f6fbb8b1619e1d31c8799
[82/87] spi: topcliff-pch: Convert to platform remove callback returning void
        commit: b082694f18bdff807b42a3bccc62c3a524168f23
[83/87] spi: uniphier: Convert to platform remove callback returning void
        commit: 1b13d196d2813dadc1947940dbd4aaad6ae21c02
[84/87] spi: xilinx: Convert to platform remove callback returning void
        commit: 3b1d7e1193315fc96f5e28d08bc3a7e3594628e5
[85/87] spi: xtensa-xtfpga: Convert to platform remove callback returning void
        commit: 795b3ac702716eca422494766cc0136b4a0554ce
[86/87] spi: zynq-qspi: Convert to platform remove callback returning void
        commit: ae9084b6458d34ebf3e377d0407ebe513e41ac71
[87/87] spi: zynqmp-gqspi: Convert to platform remove callback returning void
        commit: 3ffefa1d9c9eba60c7f8b4a9ce2df3e4c7f4a88e

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

* Re: [PATCH 00/87] spi: Convert to platform remove callback returning void
  2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (88 preceding siblings ...)
  2023-03-07 16:47 ` Mark Brown
@ 2023-03-07 17:00 ` Mark Brown
  2023-03-07 17:46   ` Uwe Kleine-König
  89 siblings, 1 reply; 115+ messages in thread
From: Mark Brown @ 2023-03-07 17:00 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Chin-Ting Kuo, Cédric Le Goater, Joel Stanley, Radu Pirea,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Tudor Ambarus,
	Florian Fainelli, Ray Jui, Scott Branden, William Zhang,
	Kursad Oney, Jonas Gorski, Anand Gore, Rafał Miłecki,
	Kamal Dasu, Serge Semin, Vladimir Oltean, Han Xu, Andy Gross,
	Bjorn Andersson, Jay Fang, Neil Armstrong, Kevin Hilman,
	Conor Dooley, Daire McNamara, Matthias Brugger, Shawn Guo,
	Sascha Hauer, Avi Fishman, Tomer Maimon, Tali Perry, Haibo Chen,
	Daniel Mack, Haojian Zhuang, Robert Jarzmik, Heiko Stuebner,
	Krzysztof Kozlowski, Andi Shyti, Palmer Dabbelt, Paul Walmsley,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Maxime Coquelin,
	Alexandre Torgue, Alain Volmat, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Li-hao Kuo, Masahisa Kojima, Jassi Brar,
	Laxman Dewangan, Thierry Reding, Jonathan Hunter,
	Sowjanya Komatineni, Kunihiko Hayashi, Masami Hiramatsu,
	Michal Simek, Max Filippov, linux-spi, Andrew Jeffery,
	linux-aspeed, openbmc, linux-arm-kernel,
	Broadcom internal kernel review list, linux-rpi-kernel,
	Konrad Dybcio, linux-arm-msm, Jerome Brunet, Martin Blumenstingl,
	linux-amlogic, linux-riscv, AngeloGioacchino Del Regno,
	linux-mediatek, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Yogesh Gaur, linux-rockchip, Alim Akhtar, linux-samsung-soc,
	linux-stm32, linux-sunxi, linux-tegra, linux-xtensa

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

On Fri, Mar 03, 2023 at 06:19:14PM +0100, Uwe Kleine-König wrote:

>   spi: mpc512x-psc: Convert to platform remove callback returning void
>   spi: mpc52xx-psc: Convert to platform remove callback returning void

As well as the Raspberry Pi patch dropped due to build failures I also
dropped these two as they conflicted with Rob's refactoring of that
driver, nothing especially complex but since there's stuff to resend
anyway...

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

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

* Re: [PATCH 00/87] spi: Convert to platform remove callback returning void
  2023-03-07 17:00 ` Mark Brown
@ 2023-03-07 17:46   ` Uwe Kleine-König
  0 siblings, 0 replies; 115+ messages in thread
From: Uwe Kleine-König @ 2023-03-07 17:46 UTC (permalink / raw)
  To: Mark Brown
  Cc: Kursad Oney, Tomer Maimon, Conor Dooley, Alim Akhtar,
	Rafał Miłecki, linux-stm32, Heiko Stuebner,
	linux-samsung-soc, Samuel Holland, Kevin Hilman, Michal Simek,
	Haibo Chen, Tudor Ambarus, NXP Linux Team, linux-sunxi,
	Anand Gore, Sascha Hauer, Scott Branden, Andrew Jeffery,
	linux-spi, Yogesh Gaur, Sowjanya Komatineni, Masami Hiramatsu,
	Pengutronix Kernel Team, Vladimir Oltean, Claudiu Beznea,
	Alexandre Belloni, Kunihiko Hayashi, Max Filippov,
	Laxman Dewangan, Jonas Gorski, Chunyan Zhang, Jonathan Hunter,
	linux-rockchip, Alain Volmat, Jerome Brunet, linux-xtensa,
	Andi Shyti, Martin Blumenstingl, linux-arm-msm, Radu Pirea,
	Jay Fang, Haojian Zhuang, Jassi Brar, Cédric Le Goater,
	linux-amlogic, linux-arm-kernel, Neil Armstrong, Maxime Coquelin,
	linux-rpi-kernel, linux-tegra, Masahisa Kojima, Fabio Estevam,
	linux-aspeed, Florian Fainelli, Benjamin Fair, Daire McNamara,
	Jernej Skrabec, Nancy Yuen, Chen-Yu Tsai,
	Broadcom internal kernel review list, Joel Stanley, Orson Zhai,
	William Zhang, Ray Jui, Baolin Wang, Li-hao Kuo, Avi Fishman,
	Konrad Dybcio, Thierry Reding, Shawn Guo, Alexandre Torgue,
	Tali Perry, linux-riscv, Robert Jarzmik, Kamal Dasu,
	Chin-Ting Kuo, Andy Gross, linux-mediatek, Paul Walmsley,
	Matthias Brugger, Han Xu, AngeloGioacchino Del Regno,
	Patrick Venture, Bjorn Andersson, Nicolas Ferre, Serge Semin,
	Krzysztof Kozlowski, Palmer Dabbelt, openbmc, Daniel Mack

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

Hello Mark,

On Tue, Mar 07, 2023 at 05:00:47PM +0000, Mark Brown wrote:
> On Fri, Mar 03, 2023 at 06:19:14PM +0100, Uwe Kleine-König wrote:
> 
> >   spi: mpc512x-psc: Convert to platform remove callback returning void
> >   spi: mpc52xx-psc: Convert to platform remove callback returning void
> 
> As well as the Raspberry Pi patch dropped due to build failures I also
> dropped these two as they conflicted with Rob's refactoring of that
> driver, nothing especially complex but since there's stuff to resend
> anyway...

Fine for me. Given that my queue of patches to convert the remove
callbacks is quite big, there is no pressure from my side to get these
all in. 84 from 87 is great already, I'll care about the remaining 3
patches (and the few drivers that don't return 0 in .remove()) later.

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

* Re: [PATCH 74/87] spi: sun4i: Convert to platform remove callback returning void
  2023-03-03 17:20 ` [PATCH 74/87] spi: sun4i: " Uwe Kleine-König
  2023-03-03 17:29   ` Andre Przywara
@ 2023-03-14 20:11   ` Jernej Škrabec
  1 sibling, 0 replies; 115+ messages in thread
From: Jernej Škrabec @ 2023-03-14 20:11 UTC (permalink / raw)
  To: Mark Brown, Chen-Yu Tsai, Samuel Holland, Uwe Kleine-König
  Cc: linux-spi, linux-arm-kernel, linux-sunxi, kernel

Dne petek, 03. marec 2023 ob 18:20:28 CET 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---

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

Best regards,
Jernej

>  drivers/spi/spi-sun4i.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
> index 6000d0761206..994d0fb50e68 100644
> --- a/drivers/spi/spi-sun4i.c
> +++ b/drivers/spi/spi-sun4i.c
> @@ -516,11 +516,9 @@ static int sun4i_spi_probe(struct platform_device
> *pdev) return ret;
>  }
> 
> -static int sun4i_spi_remove(struct platform_device *pdev)
> +static void sun4i_spi_remove(struct platform_device *pdev)
>  {
>  	pm_runtime_force_suspend(&pdev->dev);
> -
> -	return 0;
>  }
> 
>  static const struct of_device_id sun4i_spi_match[] = {
> @@ -536,7 +534,7 @@ static const struct dev_pm_ops sun4i_spi_pm_ops = {
> 
>  static struct platform_driver sun4i_spi_driver = {
>  	.probe	= sun4i_spi_probe,
> -	.remove	= sun4i_spi_remove,
> +	.remove_new = sun4i_spi_remove,
>  	.driver	= {
>  		.name		= "sun4i-spi",
>  		.of_match_table	= sun4i_spi_match,





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

* Re: [PATCH 75/87] spi: sun6i: Convert to platform remove callback returning void
  2023-03-03 17:20 ` [PATCH 75/87] spi: sun6i: " Uwe Kleine-König
  2023-03-03 17:30   ` Andre Przywara
@ 2023-03-14 20:12   ` Jernej Škrabec
  1 sibling, 0 replies; 115+ messages in thread
From: Jernej Škrabec @ 2023-03-14 20:12 UTC (permalink / raw)
  To: Mark Brown, Chen-Yu Tsai, Samuel Holland, Uwe Kleine-König
  Cc: linux-spi, linux-arm-kernel, linux-sunxi, kernel

Dne petek, 03. marec 2023 ob 18:20:29 CET 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---

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

Best regards,
Jernej

>  drivers/spi/spi-sun6i.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c
> index 23ad052528db..43c29afea6bb 100644
> --- a/drivers/spi/spi-sun6i.c
> +++ b/drivers/spi/spi-sun6i.c
> @@ -683,7 +683,7 @@ static int sun6i_spi_probe(struct platform_device *pdev)
> return ret;
>  }
> 
> -static int sun6i_spi_remove(struct platform_device *pdev)
> +static void sun6i_spi_remove(struct platform_device *pdev)
>  {
>  	struct spi_master *master = platform_get_drvdata(pdev);
> 
> @@ -693,7 +693,6 @@ static int sun6i_spi_remove(struct platform_device
> *pdev) dma_release_channel(master->dma_tx);
>  	if (master->dma_rx)
>  		dma_release_channel(master->dma_rx);
> -	return 0;
>  }
> 
>  static const struct of_device_id sun6i_spi_match[] = {
> @@ -710,7 +709,7 @@ static const struct dev_pm_ops sun6i_spi_pm_ops = {
> 
>  static struct platform_driver sun6i_spi_driver = {
>  	.probe	= sun6i_spi_probe,
> -	.remove	= sun6i_spi_remove,
> +	.remove_new = sun6i_spi_remove,
>  	.driver	= {
>  		.name		= "sun6i-spi",
>  		.of_match_table	= sun6i_spi_match,





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

end of thread, other threads:[~2023-03-14 20:12 UTC | newest]

Thread overview: 115+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 17:19 [PATCH 00/87] spi: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 01/87] spi: ar934x: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 02/87] spi: armada-3700: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 03/87] spi: aspeed-smc: " Uwe Kleine-König
2023-03-03 21:52   ` Cédric Le Goater
2023-03-03 17:19 ` [PATCH 04/87] spi: at91-usart: " Uwe Kleine-König
2023-03-06 11:57   ` Claudiu.Beznea
2023-03-03 17:19 ` [PATCH 05/87] spi: ath79: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 06/87] spi: atmel: " Uwe Kleine-König
2023-03-06 11:57   ` Claudiu.Beznea
2023-03-03 17:19 ` [PATCH 07/87] spi: au1550: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 08/87] spi: axi-spi-engine: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 09/87] spi: bcm2835: " Uwe Kleine-König
2023-03-03 17:23   ` Florian Fainelli
2023-03-06  7:04   ` Uwe Kleine-König
2023-03-06 12:26     ` Mark Brown
2023-03-03 17:19 ` [PATCH 10/87] spi: bcm2835aux: " Uwe Kleine-König
2023-03-03 17:23   ` Florian Fainelli
2023-03-03 17:19 ` [PATCH 11/87] spi: bcm63xx-hsspi: " Uwe Kleine-König
2023-03-03 17:26   ` Florian Fainelli
2023-03-03 17:19 ` [PATCH 12/87] spi: bcm63xx: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 13/87] spi: bcmbca-hsspi: " Uwe Kleine-König
2023-03-03 17:24   ` Florian Fainelli
2023-03-03 17:19 ` [PATCH 14/87] spi: brcmstb-qspi: " Uwe Kleine-König
2023-03-03 17:24   ` Florian Fainelli
2023-03-03 17:19 ` [PATCH 15/87] spi: cadence-quadspi: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 16/87] spi: cadence: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 17/87] spi: cavium-octeon: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 18/87] spi: coldfire-qspi: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 19/87] spi: davinci: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 20/87] spi: dln2: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 21/87] spi: dw-bt1: " Uwe Kleine-König
2023-03-06 15:22   ` Serge Semin
2023-03-03 17:19 ` [PATCH 22/87] spi: dw-mmio: " Uwe Kleine-König
2023-03-06 15:22   ` Serge Semin
2023-03-03 17:19 ` [PATCH 23/87] spi: ep93xx: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 24/87] spi: fsl-dspi: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 25/87] spi: fsl-espi: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 26/87] spi: fsl-lpspi: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 27/87] spi: fsl-qspi: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 28/87] spi: fsl-spi: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 29/87] spi: geni-qcom: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 30/87] spi: hisi-kunpeng: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 31/87] spi: img-spfi: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 32/87] spi: iproc-qspi: " Uwe Kleine-König
2023-03-03 17:26   ` Florian Fainelli
2023-03-03 17:19 ` [PATCH 33/87] spi: lantiq-ssc: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 34/87] spi: meson-spicc: " Uwe Kleine-König
2023-03-04 21:43   ` Martin Blumenstingl
2023-03-03 17:19 ` [PATCH 35/87] spi: meson-spifc: " Uwe Kleine-König
2023-03-04 21:43   ` Martin Blumenstingl
2023-03-03 17:19 ` [PATCH 36/87] spi: microchip-core-qspi: " Uwe Kleine-König
2023-03-03 17:45   ` Conor Dooley
2023-03-03 17:19 ` [PATCH 37/87] spi: microchip-core: " Uwe Kleine-König
2023-03-03 17:44   ` Conor Dooley
2023-03-03 17:19 ` [PATCH 38/87] spi: mpc512x-psc: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 39/87] spi: mpc52xx-psc: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 40/87] spi: mpc52xx: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 41/87] spi: mtk-nor: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 42/87] spi: mtk-snfi: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 43/87] spi: mxic: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 44/87] spi: mxs: " Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 45/87] spi: npcm-fiu: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 46/87] spi: npcm-pspi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 47/87] spi: nxp-fspi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 48/87] spi: oc-tiny: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 49/87] spi: omap-uwire: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 50/87] spi: omap2-mcspi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 51/87] spi: orion: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 52/87] spi: pic32-sqi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 53/87] spi: pic32: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 54/87] spi: ppc4xx: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 55/87] spi: pxa2xx: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 56/87] spi: qcom-qspi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 57/87] spi: rb4xx: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 58/87] spi: rockchip-sfc: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 59/87] spi: rockchip: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 60/87] spi: rpc-if: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 61/87] spi: rspi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 62/87] spi: s3c64xx: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 63/87] spi: sh-hspi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 64/87] spi: sh-msiof: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 65/87] spi: sh-sci: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 66/87] spi: sh: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 67/87] spi: sifive: " Uwe Kleine-König
2023-03-03 17:46   ` Conor Dooley
2023-03-03 18:33     ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 68/87] spi: slave-mt27xx: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 69/87] spi: sn-f-ospi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 70/87] spi: sprd-adi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 71/87] spi: st-ssc4: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 72/87] spi: stm32-qspi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 73/87] spi: stm32: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 74/87] spi: sun4i: " Uwe Kleine-König
2023-03-03 17:29   ` Andre Przywara
2023-03-14 20:11   ` Jernej Škrabec
2023-03-03 17:20 ` [PATCH 75/87] spi: sun6i: " Uwe Kleine-König
2023-03-03 17:30   ` Andre Przywara
2023-03-14 20:12   ` Jernej Škrabec
2023-03-03 17:20 ` [PATCH 76/87] spi: sunplus-sp7021: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 77/87] spi: synquacer: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 78/87] spi: tegra114: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 79/87] spi: tegra20-sflash: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 80/87] spi: tegra20-slink: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 81/87] spi: tegra210-quad: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 82/87] spi: topcliff-pch: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 83/87] spi: uniphier: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 84/87] spi: xilinx: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 85/87] spi: xtensa-xtfpga: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 86/87] spi: zynq-qspi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 87/87] spi: zynqmp-gqspi: " Uwe Kleine-König
2023-03-03 18:39 ` [PATCH 00/87] spi: " Uwe Kleine-König
2023-03-07 16:47 ` Mark Brown
2023-03-07 17:00 ` Mark Brown
2023-03-07 17:46   ` Uwe Kleine-König

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