Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH 00/52] serial: Convert to platform remove callback returning void
@ 2023-11-10 15:29 Uwe Kleine-König
  2023-11-10 15:29 ` [PATCH 03/52] serial: 8250: " Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2023-11-10 15:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, Tony Lindgren, Alexander Shiyan
  Cc: John Ogness, Ilpo Järvinen, Thomas Richard, Arnd Bergmann,
	Thomas Gleixner, kernel, linux-serial, Richard GENOUD,
	Christophe JAILLET, Yangtao Li, Joel Stanley, Andrew Jeffery,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, Al Cooper, Andy Shevchenko, Paul Cercueil,
	Vladimir Zapolskiy, Matthias Brugger, AngeloGioacchino Del Regno,
	Thierry Reding, Jonathan Hunter, Kunihiko Hayashi,
	Masami Hiramatsu, Petr Mladek, Biju Das, Johan Hovold,
	Chen-Yu Tsai, Andi Shyti, Rob Herring, Geert Uytterhoeven,
	Duje Mihanović, Rafael J. Wysocki, Jacob Keller,
	linux-arm-kernel, linux-aspeed, linux-rpi-kernel, linux-mips,
	linux-mediatek, linux-tegra, Tobias Klauser, Russell King,
	Lino Sanfilippo, Jiamei Xie, Hongyu Xie, delisun, Fabio Estevam,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Arend van Spriel, Maciej W. Rozycki, Christophe Leroy,
	Baruch Siach, Thierry Reding, Max Filippov, Zhang Shurong,
	Sherry Sun, Shenwei Wang, Shawn Guo, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, Sergey Organov, Tom Rix, Martin Fuzzey,
	Bernhard Seibold, Karol Gugala, Mateusz Holenko, Gabriel Somlo,
	Jacky Huang, Shan-Chun Hung, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, Dmitry Rokosov, Lucas Tanure,
	Pavel Krasavin, linux-amlogic, Taichi Sugaya, Takao Orito,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Andreas Färber, Manivannan Sadhasivam, linux-actions,
	Yuan Can, linux-unisoc, Krzysztof Kozlowski, Alim Akhtar,
	linux-samsung-soc, Laxman Dewangan, Geert Uytterhoeven,
	Palmer Dabbelt, Paul Walmsley, Ben Dooks, Nick Hu, Samuel Holland,
	Ruan Jinjie, linux-riscv, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Patrice Chotard, Maxime Coquelin, Alexandre Torgue,
	Valentin Caron, Marek Vasut, Sebastian Andrzej Siewior,
	Erwan Le Ray, linux-stm32, David S. Miller, sparclinux,
	Hammer Hsieh, Peter Korsgaard, Timur Tabi, linuxppc-dev,
	Michal Simek, Julien Malik

Hello,

this series starts with two fixes. The first one fixes a resource leak
and use after free. The second only improves error reporting. I added a
Fixes: marker to these. I let you decide if you want to drop them (or
the second only) or add a Cc: stable (to both or only the first one).

After that all drivers below drivers/tty/serial are converted to struct
platform_driver::remove_new. See commit 5c5a7680e67b ("platform: Provide
a remove callback that returns no value") for an extended explanation
and the eventual goal. The TL;DR; is to prevent bugs like the two fixed
here.

After these two fixes all conversations are trivial, because all
.remove() callbacks returned zero unconditionally.

The conversion patches are merge window material. The two fixes might go
in also before v6.7, but given the fixed problems are already old
(v6.1-rc6 + v3.10-rc1) there is probably no urge.

Best regards
Uwe

Uwe Kleine-König (52):
  serial: 8250: omap: Don't skip resource freeing if
    pm_runtime_resume_and_get() failed
  serial: sccnxp: Improve error message if regulator_disable() fails
  serial: 8250: Convert to platform remove callback returning void
  serial: altera_jtaguart: Convert to platform remove callback returning
    void
  serial: altera: Convert to platform remove callback returning void
  serial: amba-pl011: Convert to platform remove callback returning void
  serial: ar933x: Convert to platform remove callback returning void
  serial: atmel: Convert to platform remove callback returning void
  serial: bcm63xx: Convert to platform remove callback returning void
  serial: clps711x: Convert to platform remove callback returning void
  serial: cpm: Convert to platform remove callback returning void
  serial: digicolor: Convert to platform remove callback returning void
  serial: esp32_acm: Convert to platform remove callback returning void
  serial: esp32: Convert to platform remove callback returning void
  serial: fsl_linflexuart: Convert to platform remove callback returning
    void
  serial: fsl_lpuart: Convert to platform remove callback returning void
  serial: imx: Convert to platform remove callback returning void
  serial: lantiq: Convert to platform remove callback returning void
  serial: liteuart: Convert to platform remove callback returning void
  serial: lpc32xx_hs: Convert to platform remove callback returning void
  serial: ma35d1: Convert to platform remove callback returning void
  serial: mcf: Convert to platform remove callback returning void
  serial: meson: Convert to platform remove callback returning void
  serial: milbeaut_usio: Convert to platform remove callback returning
    void
  serial: mpc52xx: Convert to platform remove callback returning void
  serial: msm: Convert to platform remove callback returning void
  serial: mxs-auart: Convert to platform remove callback returning void
  serial: omap: Convert to platform remove callback returning void
  serial: owl: Convert to platform remove callback returning void
  serial: pic32: Convert to platform remove callback returning void
  serial: qcom_geni: Convert to platform remove callback returning void
  serial: rda: Convert to platform remove callback returning void
  serial: sa1100: Convert to platform remove callback returning void
  serial: samsung: Convert to platform remove callback returning void
  serial: sccnxp: Convert to platform remove callback returning void
  serial: tegra: Convert to platform remove callback returning void
  serial: txx9: Convert to platform remove callback returning void
  serial: sh-sci: Convert to platform remove callback returning void
  serial: sifive: Convert to platform remove callback returning void
  serial: sprd: Convert to platform remove callback returning void
  serial: st-asc: Convert to platform remove callback returning void
  serial: stm32: Convert to platform remove callback returning void
  serial: sunhv: Convert to platform remove callback returning void
  serial: sunplus: Convert to platform remove callback returning void
  serial: sunsab: Convert to platform remove callback returning void
  serial: sunsu: Convert to platform remove callback returning void
  serial: sunzilog: Convert to platform remove callback returning void
  serial: tegra-tcu: Convert to platform remove callback returning void
  serial: timbuart: Convert to platform remove callback returning void
  serial: uartlite: Convert to platform remove callback returning void
  serial: ucc: Convert to platform remove callback returning void
  serial: xilinx_uartps: Convert to platform remove callback returning
    void

 drivers/tty/serial/8250/8250_aspeed_vuart.c |  6 ++----
 drivers/tty/serial/8250/8250_bcm2835aux.c   |  6 ++----
 drivers/tty/serial/8250/8250_bcm7271.c      |  5 ++---
 drivers/tty/serial/8250/8250_core.c         |  5 ++---
 drivers/tty/serial/8250/8250_dw.c           |  6 ++----
 drivers/tty/serial/8250/8250_em.c           |  5 ++---
 drivers/tty/serial/8250/8250_fsl.c          |  5 ++---
 drivers/tty/serial/8250/8250_ingenic.c      |  5 ++---
 drivers/tty/serial/8250/8250_ioc3.c         |  5 ++---
 drivers/tty/serial/8250/8250_lpc18xx.c      |  6 ++----
 drivers/tty/serial/8250/8250_mtk.c          |  6 ++----
 drivers/tty/serial/8250/8250_of.c           |  5 ++---
 drivers/tty/serial/8250/8250_omap.c         |  7 +++----
 drivers/tty/serial/8250/8250_pxa.c          |  6 ++----
 drivers/tty/serial/8250/8250_tegra.c        |  6 ++----
 drivers/tty/serial/8250/8250_uniphier.c     |  6 ++----
 drivers/tty/serial/altera_jtaguart.c        |  6 ++----
 drivers/tty/serial/altera_uart.c            |  6 ++----
 drivers/tty/serial/amba-pl011.c             |  5 ++---
 drivers/tty/serial/ar933x_uart.c            |  6 ++----
 drivers/tty/serial/atmel_serial.c           |  6 ++----
 drivers/tty/serial/bcm63xx_uart.c           |  5 ++---
 drivers/tty/serial/clps711x.c               |  6 ++----
 drivers/tty/serial/cpm_uart.c               |  6 ++----
 drivers/tty/serial/digicolor-usart.c        |  6 ++----
 drivers/tty/serial/esp32_acm.c              |  5 ++---
 drivers/tty/serial/esp32_uart.c             |  6 ++----
 drivers/tty/serial/fsl_linflexuart.c        |  6 ++----
 drivers/tty/serial/fsl_lpuart.c             |  5 ++---
 drivers/tty/serial/imx.c                    |  6 ++----
 drivers/tty/serial/lantiq.c                 |  6 ++----
 drivers/tty/serial/liteuart.c               |  6 ++----
 drivers/tty/serial/lpc32xx_hs.c             |  6 ++----
 drivers/tty/serial/ma35d1_serial.c          |  5 ++---
 drivers/tty/serial/mcf.c                    |  6 ++----
 drivers/tty/serial/meson_uart.c             |  8 +++-----
 drivers/tty/serial/milbeaut_usio.c          |  6 ++----
 drivers/tty/serial/mpc52xx_uart.c           |  7 ++-----
 drivers/tty/serial/msm_serial.c             |  6 ++----
 drivers/tty/serial/mxs-auart.c              |  6 ++----
 drivers/tty/serial/omap-serial.c            |  6 ++----
 drivers/tty/serial/owl-uart.c               |  6 ++----
 drivers/tty/serial/pic32_uart.c             |  7 ++-----
 drivers/tty/serial/qcom_geni_serial.c       |  6 ++----
 drivers/tty/serial/rda-uart.c               |  6 ++----
 drivers/tty/serial/sa1100.c                 |  6 ++----
 drivers/tty/serial/samsung_tty.c            |  6 ++----
 drivers/tty/serial/sccnxp.c                 | 13 +++++++------
 drivers/tty/serial/serial-tegra.c           |  5 ++---
 drivers/tty/serial/serial_txx9.c            |  5 ++---
 drivers/tty/serial/sh-sci.c                 |  6 ++----
 drivers/tty/serial/sifive.c                 |  6 ++----
 drivers/tty/serial/sprd_serial.c            |  6 ++----
 drivers/tty/serial/st-asc.c                 |  6 ++----
 drivers/tty/serial/stm32-usart.c            |  6 ++----
 drivers/tty/serial/sunhv.c                  |  6 ++----
 drivers/tty/serial/sunplus-uart.c           |  6 ++----
 drivers/tty/serial/sunsab.c                 |  6 ++----
 drivers/tty/serial/sunsu.c                  |  6 ++----
 drivers/tty/serial/sunzilog.c               |  6 ++----
 drivers/tty/serial/tegra-tcu.c              |  6 ++----
 drivers/tty/serial/timbuart.c               |  6 ++----
 drivers/tty/serial/uartlite.c               |  5 ++---
 drivers/tty/serial/ucc_uart.c               |  6 ++----
 drivers/tty/serial/xilinx_uartps.c          |  5 ++---
 65 files changed, 137 insertions(+), 249 deletions(-)


base-commit: 8728c14129df7a6e29188a2e737b4774fb200953
-- 
2.42.0


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

* [PATCH 03/52] serial: 8250: Convert to platform remove callback returning void
  2023-11-10 15:29 [PATCH 00/52] serial: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-11-10 15:29 ` Uwe Kleine-König
  2023-11-10 17:49   ` Florian Fainelli
                     ` (3 more replies)
  2023-11-10 15:30 ` [PATCH 36/52] serial: tegra: " Uwe Kleine-König
  2023-11-10 15:30 ` [PATCH 48/52] serial: tegra-tcu: " Uwe Kleine-König
  2 siblings, 4 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2023-11-10 15:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: Joel Stanley, Andrew Jeffery, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Al Cooper, Ilpo Järvinen, Andy Shevchenko, Paul Cercueil,
	Vladimir Zapolskiy, Matthias Brugger, AngeloGioacchino Del Regno,
	Thierry Reding, Jonathan Hunter, Kunihiko Hayashi,
	Masami Hiramatsu, John Ogness, Thomas Gleixner, Tony Lindgren,
	Petr Mladek, Biju Das, Johan Hovold, Chen-Yu Tsai, Andi Shyti,
	Thomas Richard, Rob Herring, Geert Uytterhoeven, Arnd Bergmann,
	Duje Mihanović, Rafael J. Wysocki, Jacob Keller,
	Christophe JAILLET, kernel, linux-serial, linux-arm-kernel,
	linux-aspeed, linux-rpi-kernel, linux-mips, linux-mediatek,
	linux-tegra

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/tty/serial/8250/8250_aspeed_vuart.c | 6 ++----
 drivers/tty/serial/8250/8250_bcm2835aux.c   | 6 ++----
 drivers/tty/serial/8250/8250_bcm7271.c      | 5 ++---
 drivers/tty/serial/8250/8250_core.c         | 5 ++---
 drivers/tty/serial/8250/8250_dw.c           | 6 ++----
 drivers/tty/serial/8250/8250_em.c           | 5 ++---
 drivers/tty/serial/8250/8250_fsl.c          | 5 ++---
 drivers/tty/serial/8250/8250_ingenic.c      | 5 ++---
 drivers/tty/serial/8250/8250_ioc3.c         | 5 ++---
 drivers/tty/serial/8250/8250_lpc18xx.c      | 6 ++----
 drivers/tty/serial/8250/8250_mtk.c          | 6 ++----
 drivers/tty/serial/8250/8250_of.c           | 5 ++---
 drivers/tty/serial/8250/8250_omap.c         | 5 ++---
 drivers/tty/serial/8250/8250_pxa.c          | 6 ++----
 drivers/tty/serial/8250/8250_tegra.c        | 6 ++----
 drivers/tty/serial/8250/8250_uniphier.c     | 6 ++----
 16 files changed, 32 insertions(+), 56 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c
index d7482ae33a1c..8c2aaf7af7b7 100644
--- a/drivers/tty/serial/8250/8250_aspeed_vuart.c
+++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c
@@ -566,7 +566,7 @@ static int aspeed_vuart_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static int aspeed_vuart_remove(struct platform_device *pdev)
+static void aspeed_vuart_remove(struct platform_device *pdev)
 {
 	struct aspeed_vuart *vuart = platform_get_drvdata(pdev);
 
@@ -574,8 +574,6 @@ static int aspeed_vuart_remove(struct platform_device *pdev)
 	aspeed_vuart_set_enabled(vuart, false);
 	serial8250_unregister_port(vuart->line);
 	sysfs_remove_group(&vuart->dev->kobj, &aspeed_vuart_attr_group);
-
-	return 0;
 }
 
 static const struct of_device_id aspeed_vuart_table[] = {
@@ -590,7 +588,7 @@ static struct platform_driver aspeed_vuart_driver = {
 		.of_match_table = aspeed_vuart_table,
 	},
 	.probe = aspeed_vuart_probe,
-	.remove = aspeed_vuart_remove,
+	.remove_new = aspeed_vuart_remove,
 };
 
 module_platform_driver(aspeed_vuart_driver);
diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
index 15a2387a5b25..b5760f914a8c 100644
--- a/drivers/tty/serial/8250/8250_bcm2835aux.c
+++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
@@ -195,14 +195,12 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int bcm2835aux_serial_remove(struct platform_device *pdev)
+static void bcm2835aux_serial_remove(struct platform_device *pdev)
 {
 	struct bcm2835aux_data *data = platform_get_drvdata(pdev);
 
 	serial8250_unregister_port(data->line);
 	clk_disable_unprepare(data->clk);
-
-	return 0;
 }
 
 static const struct bcm2835_aux_serial_driver_data bcm2835_acpi_data = {
@@ -228,7 +226,7 @@ static struct platform_driver bcm2835aux_serial_driver = {
 		.acpi_match_table = bcm2835aux_serial_acpi_match,
 	},
 	.probe  = bcm2835aux_serial_probe,
-	.remove = bcm2835aux_serial_remove,
+	.remove_new = bcm2835aux_serial_remove,
 };
 module_platform_driver(bcm2835aux_serial_driver);
 
diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c
index 55dea2539c47..504c4c020857 100644
--- a/drivers/tty/serial/8250/8250_bcm7271.c
+++ b/drivers/tty/serial/8250/8250_bcm7271.c
@@ -1121,7 +1121,7 @@ static int brcmuart_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int brcmuart_remove(struct platform_device *pdev)
+static void brcmuart_remove(struct platform_device *pdev)
 {
 	struct brcmuart_priv *priv = platform_get_drvdata(pdev);
 
@@ -1131,7 +1131,6 @@ static int brcmuart_remove(struct platform_device *pdev)
 	brcmuart_free_bufs(&pdev->dev, priv);
 	if (priv->dma_enabled)
 		brcmuart_arbitration(priv, 0);
-	return 0;
 }
 
 static int __maybe_unused brcmuart_suspend(struct device *dev)
@@ -1207,7 +1206,7 @@ static struct platform_driver brcmuart_platform_driver = {
 		.of_match_table = brcmuart_dt_ids,
 	},
 	.probe		= brcmuart_probe,
-	.remove		= brcmuart_remove,
+	.remove_new	= brcmuart_remove,
 };
 
 static int __init brcmuart_init(void)
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 912733151858..b62ad9006780 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -883,7 +883,7 @@ static int serial8250_probe(struct platform_device *dev)
 /*
  * Remove serial ports registered against a platform device.
  */
-static int serial8250_remove(struct platform_device *dev)
+static void serial8250_remove(struct platform_device *dev)
 {
 	int i;
 
@@ -893,7 +893,6 @@ static int serial8250_remove(struct platform_device *dev)
 		if (up->port.dev == &dev->dev)
 			serial8250_unregister_port(i);
 	}
-	return 0;
 }
 
 static int serial8250_suspend(struct platform_device *dev, pm_message_t state)
@@ -926,7 +925,7 @@ static int serial8250_resume(struct platform_device *dev)
 
 static struct platform_driver serial8250_isa_driver = {
 	.probe		= serial8250_probe,
-	.remove		= serial8250_remove,
+	.remove_new	= serial8250_remove,
 	.suspend	= serial8250_suspend,
 	.resume		= serial8250_resume,
 	.driver		= {
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index b94f567647cb..63b14ce9c009 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -663,7 +663,7 @@ static int dw8250_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int dw8250_remove(struct platform_device *pdev)
+static void dw8250_remove(struct platform_device *pdev)
 {
 	struct dw8250_data *data = platform_get_drvdata(pdev);
 	struct device *dev = &pdev->dev;
@@ -680,8 +680,6 @@ static int dw8250_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(dev);
 	pm_runtime_put_noidle(dev);
-
-	return 0;
 }
 
 static int dw8250_suspend(struct device *dev)
@@ -789,7 +787,7 @@ static struct platform_driver dw8250_platform_driver = {
 		.acpi_match_table = dw8250_acpi_match,
 	},
 	.probe			= dw8250_probe,
-	.remove			= dw8250_remove,
+	.remove_new		= dw8250_remove,
 };
 
 module_platform_driver(dw8250_platform_driver);
diff --git a/drivers/tty/serial/8250/8250_em.c b/drivers/tty/serial/8250/8250_em.c
index ef5019e944ea..a754755100ff 100644
--- a/drivers/tty/serial/8250/8250_em.c
+++ b/drivers/tty/serial/8250/8250_em.c
@@ -200,12 +200,11 @@ static int serial8250_em_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int serial8250_em_remove(struct platform_device *pdev)
+static void serial8250_em_remove(struct platform_device *pdev)
 {
 	struct serial8250_em_priv *priv = platform_get_drvdata(pdev);
 
 	serial8250_unregister_port(priv->line);
-	return 0;
 }
 
 static const struct of_device_id serial8250_em_dt_ids[] = {
@@ -220,7 +219,7 @@ static struct platform_driver serial8250_em_platform_driver = {
 		.of_match_table = serial8250_em_dt_ids,
 	},
 	.probe			= serial8250_em_probe,
-	.remove			= serial8250_em_remove,
+	.remove_new		= serial8250_em_remove,
 };
 
 module_platform_driver(serial8250_em_platform_driver);
diff --git a/drivers/tty/serial/8250/8250_fsl.c b/drivers/tty/serial/8250/8250_fsl.c
index f522eb5026c9..5cf675eadefe 100644
--- a/drivers/tty/serial/8250/8250_fsl.c
+++ b/drivers/tty/serial/8250/8250_fsl.c
@@ -159,12 +159,11 @@ static int fsl8250_acpi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int fsl8250_acpi_remove(struct platform_device *pdev)
+static void fsl8250_acpi_remove(struct platform_device *pdev)
 {
 	struct fsl8250_data *data = platform_get_drvdata(pdev);
 
 	serial8250_unregister_port(data->line);
-	return 0;
 }
 
 static const struct acpi_device_id fsl_8250_acpi_id[] = {
@@ -179,7 +178,7 @@ static struct platform_driver fsl8250_platform_driver = {
 		.acpi_match_table	= ACPI_PTR(fsl_8250_acpi_id),
 	},
 	.probe			= fsl8250_acpi_probe,
-	.remove			= fsl8250_acpi_remove,
+	.remove_new		= fsl8250_acpi_remove,
 };
 
 module_platform_driver(fsl8250_platform_driver);
diff --git a/drivers/tty/serial/8250/8250_ingenic.c b/drivers/tty/serial/8250/8250_ingenic.c
index 4c4c4da73ad0..a12f737924c0 100644
--- a/drivers/tty/serial/8250/8250_ingenic.c
+++ b/drivers/tty/serial/8250/8250_ingenic.c
@@ -320,14 +320,13 @@ static int ingenic_uart_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int ingenic_uart_remove(struct platform_device *pdev)
+static void ingenic_uart_remove(struct platform_device *pdev)
 {
 	struct ingenic_uart_data *data = platform_get_drvdata(pdev);
 
 	serial8250_unregister_port(data->line);
 	clk_disable_unprepare(data->clk_module);
 	clk_disable_unprepare(data->clk_baud);
-	return 0;
 }
 
 static const struct ingenic_uart_config jz4740_uart_config = {
@@ -368,7 +367,7 @@ static struct platform_driver ingenic_uart_platform_driver = {
 		.of_match_table	= of_match,
 	},
 	.probe			= ingenic_uart_probe,
-	.remove			= ingenic_uart_remove,
+	.remove_new		= ingenic_uart_remove,
 };
 
 module_platform_driver(ingenic_uart_platform_driver);
diff --git a/drivers/tty/serial/8250/8250_ioc3.c b/drivers/tty/serial/8250/8250_ioc3.c
index d5a39e105a76..50c77c3dacf2 100644
--- a/drivers/tty/serial/8250/8250_ioc3.c
+++ b/drivers/tty/serial/8250/8250_ioc3.c
@@ -75,17 +75,16 @@ static int serial8250_ioc3_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int serial8250_ioc3_remove(struct platform_device *pdev)
+static void serial8250_ioc3_remove(struct platform_device *pdev)
 {
 	struct ioc3_8250_data *data = platform_get_drvdata(pdev);
 
 	serial8250_unregister_port(data->line);
-	return 0;
 }
 
 static struct platform_driver serial8250_ioc3_driver = {
 	.probe  = serial8250_ioc3_probe,
-	.remove = serial8250_ioc3_remove,
+	.remove_new = serial8250_ioc3_remove,
 	.driver = {
 		.name = "ioc3-serial8250",
 	}
diff --git a/drivers/tty/serial/8250/8250_lpc18xx.c b/drivers/tty/serial/8250/8250_lpc18xx.c
index 6dc85aaba5d0..8d728a6a5991 100644
--- a/drivers/tty/serial/8250/8250_lpc18xx.c
+++ b/drivers/tty/serial/8250/8250_lpc18xx.c
@@ -182,15 +182,13 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int lpc18xx_serial_remove(struct platform_device *pdev)
+static void lpc18xx_serial_remove(struct platform_device *pdev)
 {
 	struct lpc18xx_uart_data *data = platform_get_drvdata(pdev);
 
 	serial8250_unregister_port(data->line);
 	clk_disable_unprepare(data->clk_uart);
 	clk_disable_unprepare(data->clk_reg);
-
-	return 0;
 }
 
 static const struct of_device_id lpc18xx_serial_match[] = {
@@ -201,7 +199,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_serial_match);
 
 static struct platform_driver lpc18xx_serial_driver = {
 	.probe  = lpc18xx_serial_probe,
-	.remove = lpc18xx_serial_remove,
+	.remove_new = lpc18xx_serial_remove,
 	.driver = {
 		.name = "lpc18xx-uart",
 		.of_match_table = lpc18xx_serial_match,
diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
index 23457daae8a1..9ff6bbe9c086 100644
--- a/drivers/tty/serial/8250/8250_mtk.c
+++ b/drivers/tty/serial/8250/8250_mtk.c
@@ -581,7 +581,7 @@ static int mtk8250_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int mtk8250_remove(struct platform_device *pdev)
+static void mtk8250_remove(struct platform_device *pdev)
 {
 	struct mtk8250_data *data = platform_get_drvdata(pdev);
 
@@ -591,8 +591,6 @@ static int mtk8250_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_put_noidle(&pdev->dev);
-
-	return 0;
 }
 
 static int __maybe_unused mtk8250_suspend(struct device *dev)
@@ -652,7 +650,7 @@ static struct platform_driver mtk8250_platform_driver = {
 		.of_match_table	= mtk8250_of_match,
 	},
 	.probe			= mtk8250_probe,
-	.remove			= mtk8250_remove,
+	.remove_new		= mtk8250_remove,
 };
 module_platform_driver(mtk8250_platform_driver);
 
diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index ef3e745bd09c..34f17a9785e7 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -251,7 +251,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
 /*
  * Release a line
  */
-static int of_platform_serial_remove(struct platform_device *ofdev)
+static void of_platform_serial_remove(struct platform_device *ofdev)
 {
 	struct of_serial_info *info = platform_get_drvdata(ofdev);
 
@@ -261,7 +261,6 @@ static int of_platform_serial_remove(struct platform_device *ofdev)
 	pm_runtime_put_sync(&ofdev->dev);
 	pm_runtime_disable(&ofdev->dev);
 	kfree(info);
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -337,7 +336,7 @@ static struct platform_driver of_platform_serial_driver = {
 		.pm = &of_serial_pm_ops,
 	},
 	.probe = of_platform_serial_probe,
-	.remove = of_platform_serial_remove,
+	.remove_new = of_platform_serial_remove,
 };
 
 module_platform_driver(of_platform_serial_driver);
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index 661a83dbc11b..5a89a8cd7f71 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1584,7 +1584,7 @@ static int omap8250_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int omap8250_remove(struct platform_device *pdev)
+static void omap8250_remove(struct platform_device *pdev)
 {
 	struct omap8250_priv *priv = platform_get_drvdata(pdev);
 	struct uart_8250_port *up;
@@ -1604,7 +1604,6 @@ static int omap8250_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 	cpu_latency_qos_remove_request(&priv->pm_qos_request);
 	device_init_wakeup(&pdev->dev, false);
-	return 0;
 }
 
 static int omap8250_prepare(struct device *dev)
@@ -1863,7 +1862,7 @@ static struct platform_driver omap8250_platform_driver = {
 		.of_match_table = omap8250_dt_ids,
 	},
 	.probe			= omap8250_probe,
-	.remove			= omap8250_remove,
+	.remove_new		= omap8250_remove,
 };
 module_platform_driver(omap8250_platform_driver);
 
diff --git a/drivers/tty/serial/8250/8250_pxa.c b/drivers/tty/serial/8250/8250_pxa.c
index a5b3ea27fc90..77686da42ce8 100644
--- a/drivers/tty/serial/8250/8250_pxa.c
+++ b/drivers/tty/serial/8250/8250_pxa.c
@@ -146,20 +146,18 @@ static int serial_pxa_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int serial_pxa_remove(struct platform_device *pdev)
+static void serial_pxa_remove(struct platform_device *pdev)
 {
 	struct pxa8250_data *data = platform_get_drvdata(pdev);
 
 	serial8250_unregister_port(data->line);
 
 	clk_unprepare(data->clk);
-
-	return 0;
 }
 
 static struct platform_driver serial_pxa_driver = {
 	.probe          = serial_pxa_probe,
-	.remove         = serial_pxa_remove,
+	.remove_new     = serial_pxa_remove,
 
 	.driver		= {
 		.name	= "pxa2xx-uart",
diff --git a/drivers/tty/serial/8250/8250_tegra.c b/drivers/tty/serial/8250/8250_tegra.c
index 89956bbf34d9..ba352262df75 100644
--- a/drivers/tty/serial/8250/8250_tegra.c
+++ b/drivers/tty/serial/8250/8250_tegra.c
@@ -128,15 +128,13 @@ static int tegra_uart_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tegra_uart_remove(struct platform_device *pdev)
+static void tegra_uart_remove(struct platform_device *pdev)
 {
 	struct tegra_uart *uart = platform_get_drvdata(pdev);
 
 	serial8250_unregister_port(uart->line);
 	reset_control_assert(uart->rst);
 	clk_disable_unprepare(uart->clk);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -192,7 +190,7 @@ static struct platform_driver tegra_uart_driver = {
 		.acpi_match_table = ACPI_PTR(tegra_uart_acpi_match),
 	},
 	.probe = tegra_uart_probe,
-	.remove = tegra_uart_remove,
+	.remove_new = tegra_uart_remove,
 };
 
 module_platform_driver(tegra_uart_driver);
diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c
index a405155264b1..6399a38ecce2 100644
--- a/drivers/tty/serial/8250/8250_uniphier.c
+++ b/drivers/tty/serial/8250/8250_uniphier.c
@@ -241,14 +241,12 @@ static int uniphier_uart_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int uniphier_uart_remove(struct platform_device *pdev)
+static void uniphier_uart_remove(struct platform_device *pdev)
 {
 	struct uniphier8250_priv *priv = platform_get_drvdata(pdev);
 
 	serial8250_unregister_port(priv->line);
 	clk_disable_unprepare(priv->clk);
-
-	return 0;
 }
 
 static int __maybe_unused uniphier_uart_suspend(struct device *dev)
@@ -293,7 +291,7 @@ MODULE_DEVICE_TABLE(of, uniphier_uart_match);
 
 static struct platform_driver uniphier_uart_platform_driver = {
 	.probe		= uniphier_uart_probe,
-	.remove		= uniphier_uart_remove,
+	.remove_new	= uniphier_uart_remove,
 	.driver = {
 		.name	= "uniphier-uart",
 		.of_match_table = uniphier_uart_match,
-- 
2.42.0


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

* [PATCH 36/52] serial: tegra: Convert to platform remove callback returning void
  2023-11-10 15:29 [PATCH 00/52] serial: Convert to platform remove callback returning void Uwe Kleine-König
  2023-11-10 15:29 ` [PATCH 03/52] serial: 8250: " Uwe Kleine-König
@ 2023-11-10 15:30 ` Uwe Kleine-König
  2023-11-10 15:30 ` [PATCH 48/52] serial: tegra-tcu: " Uwe Kleine-König
  2 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2023-11-10 15:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: Laxman Dewangan, Thierry Reding, Jonathan Hunter, kernel,
	linux-serial, linux-tegra

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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

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

diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index 6d4006b41975..525f3a2f7bd4 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -1611,13 +1611,12 @@ static int tegra_uart_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tegra_uart_remove(struct platform_device *pdev)
+static void tegra_uart_remove(struct platform_device *pdev)
 {
 	struct tegra_uart_port *tup = platform_get_drvdata(pdev);
 	struct uart_port *u = &tup->uport;
 
 	uart_remove_one_port(&tegra_uart_driver, u);
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -1644,7 +1643,7 @@ static const struct dev_pm_ops tegra_uart_pm_ops = {
 
 static struct platform_driver tegra_uart_platform_driver = {
 	.probe		= tegra_uart_probe,
-	.remove		= tegra_uart_remove,
+	.remove_new	= tegra_uart_remove,
 	.driver		= {
 		.name	= "serial-tegra",
 		.of_match_table = tegra_uart_of_match,
-- 
2.42.0


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

* [PATCH 48/52] serial: tegra-tcu: Convert to platform remove callback returning void
  2023-11-10 15:29 [PATCH 00/52] serial: Convert to platform remove callback returning void Uwe Kleine-König
  2023-11-10 15:29 ` [PATCH 03/52] serial: 8250: " Uwe Kleine-König
  2023-11-10 15:30 ` [PATCH 36/52] serial: tegra: " Uwe Kleine-König
@ 2023-11-10 15:30 ` Uwe Kleine-König
  2 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2023-11-10 15:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: Thierry Reding, Jonathan Hunter, Rob Herring, kernel,
	linux-serial, linux-tegra

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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

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

diff --git a/drivers/tty/serial/tegra-tcu.c b/drivers/tty/serial/tegra-tcu.c
index 65069daf36ec..d9c78320eb02 100644
--- a/drivers/tty/serial/tegra-tcu.c
+++ b/drivers/tty/serial/tegra-tcu.c
@@ -266,7 +266,7 @@ static int tegra_tcu_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int tegra_tcu_remove(struct platform_device *pdev)
+static void tegra_tcu_remove(struct platform_device *pdev)
 {
 	struct tegra_tcu *tcu = platform_get_drvdata(pdev);
 
@@ -277,8 +277,6 @@ static int tegra_tcu_remove(struct platform_device *pdev)
 	uart_remove_one_port(&tcu->driver, &tcu->port);
 	uart_unregister_driver(&tcu->driver);
 	mbox_free_channel(tcu->tx);
-
-	return 0;
 }
 
 static const struct of_device_id tegra_tcu_match[] = {
@@ -293,7 +291,7 @@ static struct platform_driver tegra_tcu_driver = {
 		.of_match_table = tegra_tcu_match,
 	},
 	.probe = tegra_tcu_probe,
-	.remove = tegra_tcu_remove,
+	.remove_new = tegra_tcu_remove,
 };
 module_platform_driver(tegra_tcu_driver);
 
-- 
2.42.0


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

* Re: [PATCH 03/52] serial: 8250: Convert to platform remove callback returning void
  2023-11-10 15:29 ` [PATCH 03/52] serial: 8250: " Uwe Kleine-König
@ 2023-11-10 17:49   ` Florian Fainelli
  2023-11-13  9:09   ` AngeloGioacchino Del Regno
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Florian Fainelli @ 2023-11-10 17:49 UTC (permalink / raw)
  To: Uwe Kleine-König, Greg Kroah-Hartman, Jiri Slaby
  Cc: Joel Stanley, Andrew Jeffery,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Al Cooper, Ilpo Järvinen, Andy Shevchenko, Paul Cercueil,
	Vladimir Zapolskiy, Matthias Brugger, AngeloGioacchino Del Regno,
	Thierry Reding, Jonathan Hunter, Kunihiko Hayashi,
	Masami Hiramatsu, John Ogness, Thomas Gleixner, Tony Lindgren,
	Petr Mladek, Biju Das, Johan Hovold, Chen-Yu Tsai, Andi Shyti,
	Thomas Richard, Rob Herring, Geert Uytterhoeven, Arnd Bergmann,
	Duje Mihanović, Rafael J. Wysocki, Jacob Keller,
	Christophe JAILLET, kernel, linux-serial, linux-arm-kernel,
	linux-aspeed, linux-rpi-kernel, linux-mips, linux-mediatek,
	linux-tegra

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

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

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> # 8250_bcm*
-- 
Florian


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

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

* Re: [PATCH 03/52] serial: 8250: Convert to platform remove callback returning void
  2023-11-10 15:29 ` [PATCH 03/52] serial: 8250: " Uwe Kleine-König
  2023-11-10 17:49   ` Florian Fainelli
@ 2023-11-13  9:09   ` AngeloGioacchino Del Regno
  2023-11-13 10:15   ` Geert Uytterhoeven
  2023-11-22 23:23   ` Andi Shyti
  3 siblings, 0 replies; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-11-13  9:09 UTC (permalink / raw)
  To: Uwe Kleine-König, Greg Kroah-Hartman, Jiri Slaby
  Cc: Joel Stanley, Andrew Jeffery, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Al Cooper, Ilpo Järvinen, Andy Shevchenko, Paul Cercueil,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding,
	Jonathan Hunter, Kunihiko Hayashi, Masami Hiramatsu, John Ogness,
	Thomas Gleixner, Tony Lindgren, Petr Mladek, Biju Das,
	Johan Hovold, Chen-Yu Tsai, Andi Shyti, Thomas Richard,
	Rob Herring, Geert Uytterhoeven, Arnd Bergmann,
	Duje Mihanović, Rafael J. Wysocki, Jacob Keller,
	Christophe JAILLET, kernel, linux-serial, linux-arm-kernel,
	linux-aspeed, linux-rpi-kernel, linux-mips, linux-mediatek,
	linux-tegra

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

For MediaTek:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


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

* Re: [PATCH 03/52] serial: 8250: Convert to platform remove callback returning void
  2023-11-10 15:29 ` [PATCH 03/52] serial: 8250: " Uwe Kleine-König
  2023-11-10 17:49   ` Florian Fainelli
  2023-11-13  9:09   ` AngeloGioacchino Del Regno
@ 2023-11-13 10:15   ` Geert Uytterhoeven
  2023-11-22 23:23   ` Andi Shyti
  3 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2023-11-13 10:15 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg Kroah-Hartman, Jiri Slaby, Joel Stanley, Andrew Jeffery,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, Al Cooper, Ilpo Järvinen, Andy Shevchenko,
	Paul Cercueil, Vladimir Zapolskiy, Matthias Brugger,
	AngeloGioacchino Del Regno, Thierry Reding, Jonathan Hunter,
	Kunihiko Hayashi, Masami Hiramatsu, John Ogness, Thomas Gleixner,
	Tony Lindgren, Petr Mladek, Biju Das, Johan Hovold, Chen-Yu Tsai,
	Andi Shyti, Thomas Richard, Rob Herring, Arnd Bergmann,
	Duje Mihanović, Rafael J. Wysocki, Jacob Keller,
	Christophe JAILLET, kernel, linux-serial, linux-arm-kernel,
	linux-aspeed, linux-rpi-kernel, linux-mips, linux-mediatek,
	linux-tegra

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

>  drivers/tty/serial/8250/8250_dw.c           | 6 ++----
>  drivers/tty/serial/8250/8250_em.c           | 5 ++---

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

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

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

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

* Re: [PATCH 03/52] serial: 8250: Convert to platform remove callback returning void
  2023-11-10 15:29 ` [PATCH 03/52] serial: 8250: " Uwe Kleine-König
                     ` (2 preceding siblings ...)
  2023-11-13 10:15   ` Geert Uytterhoeven
@ 2023-11-22 23:23   ` Andi Shyti
  3 siblings, 0 replies; 8+ messages in thread
From: Andi Shyti @ 2023-11-22 23:23 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Greg Kroah-Hartman, Jiri Slaby, Joel Stanley, Andrew Jeffery,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, Al Cooper, Ilpo Järvinen, Andy Shevchenko,
	Paul Cercueil, Vladimir Zapolskiy, Matthias Brugger,
	AngeloGioacchino Del Regno, Thierry Reding, Jonathan Hunter,
	Kunihiko Hayashi, Masami Hiramatsu, John Ogness, Thomas Gleixner,
	Tony Lindgren, Petr Mladek, Biju Das, Johan Hovold, Chen-Yu Tsai,
	Andi Shyti, Thomas Richard, Rob Herring, Geert Uytterhoeven,
	Arnd Bergmann, Duje Mihanović, Rafael J. Wysocki,
	Jacob Keller, Christophe JAILLET, kernel, linux-serial,
	linux-arm-kernel, linux-aspeed, linux-rpi-kernel, linux-mips,
	linux-mediatek, linux-tegra

Hi Uwe,

On Fri, Nov 10, 2023 at 04:29:31PM +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 ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> 
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new(), which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>

Thanks,
Andi

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

end of thread, other threads:[~2023-11-22 23:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-10 15:29 [PATCH 00/52] serial: Convert to platform remove callback returning void Uwe Kleine-König
2023-11-10 15:29 ` [PATCH 03/52] serial: 8250: " Uwe Kleine-König
2023-11-10 17:49   ` Florian Fainelli
2023-11-13  9:09   ` AngeloGioacchino Del Regno
2023-11-13 10:15   ` Geert Uytterhoeven
2023-11-22 23:23   ` Andi Shyti
2023-11-10 15:30 ` [PATCH 36/52] serial: tegra: " Uwe Kleine-König
2023-11-10 15:30 ` [PATCH 48/52] serial: tegra-tcu: " 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