linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void
@ 2023-03-18 23:53 Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 01/51] video: fbdev: au1100fb: Drop if with an always false condition Uwe Kleine-König
                   ` (52 more replies)
  0 siblings, 53 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Yihao Han, Jaya Kumar, Javier Martinez Canillas,
	Thomas Zimmermann, Wolfram Sang, Alexander Shiyan, Dongliang Mu,
	Peter Jones, Gaosheng Cui, Timur Tabi, Xuezhi Zhang,
	Jiasheng Jiang, Ferenc Bakonyi, Sascha Hauer, Shawn Guo,
	Christophe Leroy, Stephen Kitt, Daniel Thompson, Mark Brown,
	Rob Herring, Bartlomiej Zolnierkiewicz, Arnd Bergmann,
	Tony Lindgren, Jiapeng Chong, Yu Zhe, Xu Panda, Zhang Qilong,
	Hyunwoo Kim, Yang Yingliang, Robert Jarzmik, Ulf Hansson,
	wangkailong, Wang Qing, Kristoffer Ericson, Jingoo Han,
	ye xingchen, Geert Uytterhoeven, Hans de Goede,
	Michal Januszewski, Daniel Vetter, Zeng Heng,
	Florian Tobias Schandinat, Michal Simek
  Cc: linux-fbdev, dri-devel, kernel, linux-arm-kernel, linux-nvidia,
	Fabio Estevam, NXP Linux Team, linux-omap

Hello,

this series adapts the platform drivers below drivers/video/fbdev 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.

The first patch simplifies the remove callback of one driver to obviously
always return zero. After that all drivers are converted trivially to
.remove_new().

Best regards
Uwe

Uwe Kleine-König (51):
  video: fbdev: au1100fb: Drop if with an always false condition
  video: fbdev: arcfb: Convert to platform remove callback returning
    void
  video: fbdev: au1100fb: Convert to platform remove callback returning
    void
  video: fbdev: au1200fb: Convert to platform remove callback returning
    void
  video: fbdev: broadsheetfb: Convert to platform remove callback
    returning void
  video: fbdev: bw2: Convert to platform remove callback returning void
  video: fbdev: cg14: Convert to platform remove callback returning void
  video: fbdev: cg3: Convert to platform remove callback returning void
  video: fbdev: cg6: Convert to platform remove callback returning void
  video: fbdev: clps711x-fb: Convert to platform remove callback
    returning void
  video: fbdev: cobalt_lcdfb: Convert to platform remove callback
    returning void
  video: fbdev: da8xx-fb: Convert to platform remove callback returning
    void
  video: fbdev: efifb: Convert to platform remove callback returning
    void
  video: fbdev: ep93xx-fb: Convert to platform remove callback returning
    void
  video: fbdev: ffb: Convert to platform remove callback returning void
  video: fbdev: fsl-diu-fb: Convert to platform remove callback
    returning void
  video: fbdev: gbefb: Convert to platform remove callback returning
    void
  video: fbdev: goldfishfb: Convert to platform remove callback
    returning void
  video: fbdev: grvga: Convert to platform remove callback returning
    void
  video: fbdev: hecubafb: Convert to platform remove callback returning
    void
  video: fbdev: hgafb: Convert to platform remove callback returning
    void
  video: fbdev: hitfb: Convert to platform remove callback returning
    void
  video: fbdev: imxfb: Convert to platform remove callback returning
    void
  video: fbdev: leo: Convert to platform remove callback returning void
  video: fbdev: mb862xx: Convert to platform remove callback returning
    void
  video: fbdev: metronomefb: Convert to platform remove callback
    returning void
  video: fbdev: mx3fb: Convert to platform remove callback returning
    void
  video: fbdev: ocfb: Convert to platform remove callback returning void
  video: fbdev: offb: Convert to platform remove callback returning void
  video: fbdev: omapfb: Convert to platform remove callback returning
    void
  video: fbdev: p9100: Convert to platform remove callback returning
    void
  video: fbdev: platinumfb: Convert to platform remove callback
    returning void
  video: fbdev: pxa168fb: Convert to platform remove callback returning
    void
  video: fbdev: pxa3xx-gcu: Convert to platform remove callback
    returning void
  video: fbdev: pxafb: Convert to platform remove callback returning
    void
  video: fbdev: s1d13xxxfb: Convert to platform remove callback
    returning void
  video: fbdev: s3c-fb: Convert to platform remove callback returning
    void
  video: fbdev: sh7760fb: Convert to platform remove callback returning
    void
  video: fbdev: sh_mobile_lcdcfb: Convert to platform remove callback
    returning void
  video: fbdev: simplefb: Convert to platform remove callback returning
    void
  video: fbdev: sm501fb: Convert to platform remove callback returning
    void
  video: fbdev: tcx: Convert to platform remove callback returning void
  video: fbdev: uvesafb: Convert to platform remove callback returning
    void
  video: fbdev: vesafb: Convert to platform remove callback returning
    void
  video: fbdev: vfb: Convert to platform remove callback returning void
  video: fbdev: vga16fb: Convert to platform remove callback returning
    void
  video: fbdev: via: Convert to platform remove callback returning void
  video: fbdev: vt8500lcdfb: Convert to platform remove callback
    returning void
  video: fbdev: wm8505fb: Convert to platform remove callback returning
    void
  video: fbdev: wmt_ge_rops: Convert to platform remove callback
    returning void
  video: fbdev: xilinxfb: Convert to platform remove callback returning
    void

 drivers/video/fbdev/arcfb.c                    |  5 ++---
 drivers/video/fbdev/au1100fb.c                 | 11 +++--------
 drivers/video/fbdev/au1200fb.c                 |  6 ++----
 drivers/video/fbdev/broadsheetfb.c             |  5 ++---
 drivers/video/fbdev/bw2.c                      |  6 ++----
 drivers/video/fbdev/cg14.c                     |  6 ++----
 drivers/video/fbdev/cg3.c                      |  6 ++----
 drivers/video/fbdev/cg6.c                      |  6 ++----
 drivers/video/fbdev/clps711x-fb.c              |  6 ++----
 drivers/video/fbdev/cobalt_lcdfb.c             |  6 ++----
 drivers/video/fbdev/da8xx-fb.c                 |  6 ++----
 drivers/video/fbdev/efifb.c                    |  6 ++----
 drivers/video/fbdev/ep93xx-fb.c                |  6 ++----
 drivers/video/fbdev/ffb.c                      |  6 ++----
 drivers/video/fbdev/fsl-diu-fb.c               |  6 ++----
 drivers/video/fbdev/gbefb.c                    |  6 ++----
 drivers/video/fbdev/goldfishfb.c               |  5 ++---
 drivers/video/fbdev/grvga.c                    |  6 ++----
 drivers/video/fbdev/hecubafb.c                 |  5 ++---
 drivers/video/fbdev/hgafb.c                    |  6 ++----
 drivers/video/fbdev/hitfb.c                    |  6 ++----
 drivers/video/fbdev/imxfb.c                    |  6 ++----
 drivers/video/fbdev/leo.c                      |  6 ++----
 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c     |  5 ++---
 drivers/video/fbdev/metronomefb.c              |  5 ++---
 drivers/video/fbdev/mx3fb.c                    |  5 ++---
 drivers/video/fbdev/ocfb.c                     |  6 ++----
 drivers/video/fbdev/offb.c                     |  8 +++-----
 drivers/video/fbdev/omap/omapfb_main.c         |  6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/core.c    |  6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/dispc.c   |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c     |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c     |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dss.c     |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c   |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c   |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c     |  5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/venc.c    |  5 ++---
 drivers/video/fbdev/omap2/omapfb/omapfb-main.c |  6 ++----
 drivers/video/fbdev/p9100.c                    |  6 ++----
 drivers/video/fbdev/platinumfb.c               |  6 ++----
 drivers/video/fbdev/pxa168fb.c                 |  8 +++-----
 drivers/video/fbdev/pxa3xx-gcu.c               |  6 ++----
 drivers/video/fbdev/pxafb.c                    |  8 +++-----
 drivers/video/fbdev/s1d13xxxfb.c               |  5 ++---
 drivers/video/fbdev/s3c-fb.c                   |  6 ++----
 drivers/video/fbdev/sh7760fb.c                 |  6 ++----
 drivers/video/fbdev/sh_mobile_lcdcfb.c         |  5 ++---
 drivers/video/fbdev/simplefb.c                 |  6 ++----
 drivers/video/fbdev/sm501fb.c                  |  6 ++----
 drivers/video/fbdev/tcx.c                      |  6 ++----
 drivers/video/fbdev/uvesafb.c                  |  6 ++----
 drivers/video/fbdev/vesafb.c                   |  6 ++----
 drivers/video/fbdev/vfb.c                      |  5 ++---
 drivers/video/fbdev/vga16fb.c                  |  6 ++----
 drivers/video/fbdev/via/via-gpio.c             |  5 ++---
 drivers/video/fbdev/via/via_i2c.c              |  5 ++---
 drivers/video/fbdev/vt8500lcdfb.c              |  6 ++----
 drivers/video/fbdev/wm8505fb.c                 |  6 ++----
 drivers/video/fbdev/wmt_ge_rops.c              |  5 ++---
 drivers/video/fbdev/xilinxfb.c                 |  6 ++----
 61 files changed, 126 insertions(+), 230 deletions(-)

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
-- 
2.39.2


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

* [PATCH 01/51] video: fbdev: au1100fb: Drop if with an always false condition
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 02/51] video: fbdev: arcfb: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (51 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Yihao Han; +Cc: linux-fbdev, dri-devel, kernel

The driver core never calls a remove callback with the platform_device
pointer being NULL. So the check for this condition can just be dropped.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/fbdev/au1100fb.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index 519313b8bb00..cd27e3b81bb8 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -524,9 +524,6 @@ int au1100fb_drv_remove(struct platform_device *dev)
 {
 	struct au1100fb_device *fbdev = NULL;
 
-	if (!dev)
-		return -ENODEV;
-
 	fbdev = platform_get_drvdata(dev);
 
 #if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
-- 
2.39.2


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

* [PATCH 02/51] video: fbdev: arcfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 01/51] video: fbdev: au1100fb: Drop if with an always false condition Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 03/51] video: fbdev: au1100fb: " Uwe Kleine-König
                   ` (50 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Jaya Kumar, Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/arcfb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c
index 45e64016db32..7db593b78334 100644
--- a/drivers/video/fbdev/arcfb.c
+++ b/drivers/video/fbdev/arcfb.c
@@ -587,7 +587,7 @@ static int arcfb_probe(struct platform_device *dev)
 	return retval;
 }
 
-static int arcfb_remove(struct platform_device *dev)
+static void arcfb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
 
@@ -598,12 +598,11 @@ static int arcfb_remove(struct platform_device *dev)
 		vfree((void __force *)info->screen_base);
 		framebuffer_release(info);
 	}
-	return 0;
 }
 
 static struct platform_driver arcfb_driver = {
 	.probe	= arcfb_probe,
-	.remove = arcfb_remove,
+	.remove_new = arcfb_remove,
 	.driver	= {
 		.name	= "arcfb",
 	},
-- 
2.39.2


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

* [PATCH 03/51] video: fbdev: au1100fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 01/51] video: fbdev: au1100fb: Drop if with an always false condition Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 02/51] video: fbdev: arcfb: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 04/51] video: fbdev: au1200fb: " Uwe Kleine-König
                   ` (49 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Yihao Han; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/au1100fb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index cd27e3b81bb8..cb317398e71a 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -520,7 +520,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
 	return -ENODEV;
 }
 
-int au1100fb_drv_remove(struct platform_device *dev)
+void au1100fb_drv_remove(struct platform_device *dev)
 {
 	struct au1100fb_device *fbdev = NULL;
 
@@ -540,8 +540,6 @@ int au1100fb_drv_remove(struct platform_device *dev)
 		clk_disable_unprepare(fbdev->lcdclk);
 		clk_put(fbdev->lcdclk);
 	}
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -590,8 +588,8 @@ static struct platform_driver au1100fb_driver = {
 		.name		= "au1100-lcd",
 	},
 	.probe		= au1100fb_drv_probe,
-        .remove		= au1100fb_drv_remove,
-	.suspend	= au1100fb_drv_suspend,
+        .remove_new	= au1100fb_drv_remove,
+        .suspend	= au1100fb_drv_suspend,
         .resume		= au1100fb_drv_resume,
 };
 module_platform_driver(au1100fb_driver);
-- 
2.39.2


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

* [PATCH 04/51] video: fbdev: au1200fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 03/51] video: fbdev: au1100fb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 05/51] video: fbdev: broadsheetfb: " Uwe Kleine-König
                   ` (48 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/au1200fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index 81c315454428..b2c3150fb78f 100644
--- a/drivers/video/fbdev/au1200fb.c
+++ b/drivers/video/fbdev/au1200fb.c
@@ -1762,7 +1762,7 @@ static int au1200fb_drv_probe(struct platform_device *dev)
 	return ret;
 }
 
-static int au1200fb_drv_remove(struct platform_device *dev)
+static void au1200fb_drv_remove(struct platform_device *dev)
 {
 	struct au1200fb_platdata *pd = platform_get_drvdata(dev);
 	struct fb_info *fbi;
@@ -1785,8 +1785,6 @@ static int au1200fb_drv_remove(struct platform_device *dev)
 	}
 
 	free_irq(platform_get_irq(dev, 0), (void *)dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -1837,7 +1835,7 @@ static struct platform_driver au1200fb_driver = {
 		.pm	= AU1200FB_PMOPS,
 	},
 	.probe		= au1200fb_drv_probe,
-	.remove		= au1200fb_drv_remove,
+	.remove_new	= au1200fb_drv_remove,
 };
 module_platform_driver(au1200fb_driver);
 
-- 
2.39.2


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

* [PATCH 05/51] video: fbdev: broadsheetfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 04/51] video: fbdev: au1200fb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 06/51] video: fbdev: bw2: " Uwe Kleine-König
                   ` (47 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Javier Martinez Canillas, Thomas Zimmermann
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/broadsheetfb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/broadsheetfb.c b/drivers/video/fbdev/broadsheetfb.c
index 55e62dd96f9b..b518cacbf7cd 100644
--- a/drivers/video/fbdev/broadsheetfb.c
+++ b/drivers/video/fbdev/broadsheetfb.c
@@ -1193,7 +1193,7 @@ static int broadsheetfb_probe(struct platform_device *dev)
 
 }
 
-static int broadsheetfb_remove(struct platform_device *dev)
+static void broadsheetfb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
 
@@ -1209,12 +1209,11 @@ static int broadsheetfb_remove(struct platform_device *dev)
 		module_put(par->board->owner);
 		framebuffer_release(info);
 	}
-	return 0;
 }
 
 static struct platform_driver broadsheetfb_driver = {
 	.probe	= broadsheetfb_probe,
-	.remove = broadsheetfb_remove,
+	.remove_new = broadsheetfb_remove,
 	.driver	= {
 		.name	= "broadsheetfb",
 	},
-- 
2.39.2


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

* [PATCH 06/51] video: fbdev: bw2: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 05/51] video: fbdev: broadsheetfb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 07/51] video: fbdev: cg14: " Uwe Kleine-König
                   ` (46 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Wolfram Sang; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/bw2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/bw2.c b/drivers/video/fbdev/bw2.c
index 6403ae07970d..ddd45048a131 100644
--- a/drivers/video/fbdev/bw2.c
+++ b/drivers/video/fbdev/bw2.c
@@ -352,7 +352,7 @@ static int bw2_probe(struct platform_device *op)
 	return err;
 }
 
-static int bw2_remove(struct platform_device *op)
+static void bw2_remove(struct platform_device *op)
 {
 	struct fb_info *info = dev_get_drvdata(&op->dev);
 	struct bw2_par *par = info->par;
@@ -363,8 +363,6 @@ static int bw2_remove(struct platform_device *op)
 	of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len);
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static const struct of_device_id bw2_match[] = {
@@ -381,7 +379,7 @@ static struct platform_driver bw2_driver = {
 		.of_match_table = bw2_match,
 	},
 	.probe		= bw2_probe,
-	.remove		= bw2_remove,
+	.remove_new	= bw2_remove,
 };
 
 static int __init bw2_init(void)
-- 
2.39.2


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

* [PATCH 07/51] video: fbdev: cg14: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 06/51] video: fbdev: bw2: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 08/51] video: fbdev: cg3: " Uwe Kleine-König
                   ` (45 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/cg14.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/cg14.c b/drivers/video/fbdev/cg14.c
index 6a745eb46ca1..a028ede39c12 100644
--- a/drivers/video/fbdev/cg14.c
+++ b/drivers/video/fbdev/cg14.c
@@ -569,7 +569,7 @@ static int cg14_probe(struct platform_device *op)
 	return err;
 }
 
-static int cg14_remove(struct platform_device *op)
+static void cg14_remove(struct platform_device *op)
 {
 	struct fb_info *info = dev_get_drvdata(&op->dev);
 	struct cg14_par *par = info->par;
@@ -580,8 +580,6 @@ static int cg14_remove(struct platform_device *op)
 	cg14_unmap_regs(op, info, par);
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static const struct of_device_id cg14_match[] = {
@@ -598,7 +596,7 @@ static struct platform_driver cg14_driver = {
 		.of_match_table = cg14_match,
 	},
 	.probe		= cg14_probe,
-	.remove		= cg14_remove,
+	.remove_new	= cg14_remove,
 };
 
 static int __init cg14_init(void)
-- 
2.39.2


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

* [PATCH 08/51] video: fbdev: cg3: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (6 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 07/51] video: fbdev: cg14: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 09/51] video: fbdev: cg6: " Uwe Kleine-König
                   ` (44 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/cg3.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/cg3.c b/drivers/video/fbdev/cg3.c
index bdcc3f6ab666..77956934e00a 100644
--- a/drivers/video/fbdev/cg3.c
+++ b/drivers/video/fbdev/cg3.c
@@ -434,7 +434,7 @@ static int cg3_probe(struct platform_device *op)
 	return err;
 }
 
-static int cg3_remove(struct platform_device *op)
+static void cg3_remove(struct platform_device *op)
 {
 	struct fb_info *info = dev_get_drvdata(&op->dev);
 	struct cg3_par *par = info->par;
@@ -446,8 +446,6 @@ static int cg3_remove(struct platform_device *op)
 	of_iounmap(&op->resource[0], info->screen_base, info->fix.smem_len);
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static const struct of_device_id cg3_match[] = {
@@ -467,7 +465,7 @@ static struct platform_driver cg3_driver = {
 		.of_match_table = cg3_match,
 	},
 	.probe		= cg3_probe,
-	.remove		= cg3_remove,
+	.remove_new	= cg3_remove,
 };
 
 static int __init cg3_init(void)
-- 
2.39.2


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

* [PATCH 09/51] video: fbdev: cg6: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (7 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 08/51] video: fbdev: cg3: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 10/51] video: fbdev: clps711x-fb: " Uwe Kleine-König
                   ` (43 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/cg6.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/cg6.c b/drivers/video/fbdev/cg6.c
index 97ef43c25974..6884572efea1 100644
--- a/drivers/video/fbdev/cg6.c
+++ b/drivers/video/fbdev/cg6.c
@@ -828,7 +828,7 @@ static int cg6_probe(struct platform_device *op)
 	return err;
 }
 
-static int cg6_remove(struct platform_device *op)
+static void cg6_remove(struct platform_device *op)
 {
 	struct fb_info *info = dev_get_drvdata(&op->dev);
 	struct cg6_par *par = info->par;
@@ -839,8 +839,6 @@ static int cg6_remove(struct platform_device *op)
 	cg6_unmap_regs(op, info, par);
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static const struct of_device_id cg6_match[] = {
@@ -860,7 +858,7 @@ static struct platform_driver cg6_driver = {
 		.of_match_table = cg6_match,
 	},
 	.probe		= cg6_probe,
-	.remove		= cg6_remove,
+	.remove_new	= cg6_remove,
 };
 
 static int __init cg6_init(void)
-- 
2.39.2


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

* [PATCH 10/51] video: fbdev: clps711x-fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (8 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 09/51] video: fbdev: cg6: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 11/51] video: fbdev: cobalt_lcdfb: " Uwe Kleine-König
                   ` (42 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Alexander Shiyan, Thomas Zimmermann, Wolfram Sang
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/clps711x-fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c
index 45c75ff01eca..51160a728566 100644
--- a/drivers/video/fbdev/clps711x-fb.c
+++ b/drivers/video/fbdev/clps711x-fb.c
@@ -351,7 +351,7 @@ static int clps711x_fb_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int clps711x_fb_remove(struct platform_device *pdev)
+static void clps711x_fb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 	struct clps711x_fb_info *cfb = info->par;
@@ -361,8 +361,6 @@ static int clps711x_fb_remove(struct platform_device *pdev)
 	unregister_framebuffer(info);
 	fb_dealloc_cmap(&info->cmap);
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static const struct of_device_id clps711x_fb_dt_ids[] = {
@@ -377,7 +375,7 @@ static struct platform_driver clps711x_fb_driver = {
 		.of_match_table	= clps711x_fb_dt_ids,
 	},
 	.probe	= clps711x_fb_probe,
-	.remove	= clps711x_fb_remove,
+	.remove_new = clps711x_fb_remove,
 };
 module_platform_driver(clps711x_fb_driver);
 
-- 
2.39.2


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

* [PATCH 11/51] video: fbdev: cobalt_lcdfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (9 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 10/51] video: fbdev: clps711x-fb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 12/51] video: fbdev: da8xx-fb: " Uwe Kleine-König
                   ` (41 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/cobalt_lcdfb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/cobalt_lcdfb.c b/drivers/video/fbdev/cobalt_lcdfb.c
index 5f8b6324d2e8..feeace079425 100644
--- a/drivers/video/fbdev/cobalt_lcdfb.c
+++ b/drivers/video/fbdev/cobalt_lcdfb.c
@@ -324,7 +324,7 @@ static int cobalt_lcdfb_probe(struct platform_device *dev)
 	return 0;
 }
 
-static int cobalt_lcdfb_remove(struct platform_device *dev)
+static void cobalt_lcdfb_remove(struct platform_device *dev)
 {
 	struct fb_info *info;
 
@@ -333,13 +333,11 @@ static int cobalt_lcdfb_remove(struct platform_device *dev)
 		unregister_framebuffer(info);
 		framebuffer_release(info);
 	}
-
-	return 0;
 }
 
 static struct platform_driver cobalt_lcdfb_driver = {
 	.probe	= cobalt_lcdfb_probe,
-	.remove	= cobalt_lcdfb_remove,
+	.remove_new = cobalt_lcdfb_remove,
 	.driver	= {
 		.name	= "cobalt-lcd",
 	},
-- 
2.39.2


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

* [PATCH 12/51] video: fbdev: da8xx-fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (10 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 11/51] video: fbdev: cobalt_lcdfb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 13/51] video: fbdev: efifb: " Uwe Kleine-König
                   ` (40 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Dongliang Mu; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/da8xx-fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c
index cd07e401b326..60cd1286370f 100644
--- a/drivers/video/fbdev/da8xx-fb.c
+++ b/drivers/video/fbdev/da8xx-fb.c
@@ -1064,7 +1064,7 @@ static void lcd_da8xx_cpufreq_deregister(struct da8xx_fb_par *par)
 }
 #endif
 
-static int fb_remove(struct platform_device *dev)
+static void fb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
 	struct da8xx_fb_par *par = info->par;
@@ -1091,8 +1091,6 @@ static int fb_remove(struct platform_device *dev)
 	pm_runtime_put_sync(&dev->dev);
 	pm_runtime_disable(&dev->dev);
 	framebuffer_release(info);
-
-	return 0;
 }
 
 /*
@@ -1657,7 +1655,7 @@ static SIMPLE_DEV_PM_OPS(fb_pm_ops, fb_suspend, fb_resume);
 
 static struct platform_driver da8xx_fb_driver = {
 	.probe = fb_probe,
-	.remove = fb_remove,
+	.remove_new = fb_remove,
 	.driver = {
 		   .name = DRIVER_NAME,
 		   .pm	= &fb_pm_ops,
-- 
2.39.2


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

* [PATCH 13/51] video: fbdev: efifb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (11 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 12/51] video: fbdev: da8xx-fb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 14/51] video: fbdev: ep93xx-fb: " Uwe Kleine-König
                   ` (39 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Peter Jones, Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/efifb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index a5779fb453a2..3d7be69ab593 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -621,15 +621,13 @@ static int efifb_probe(struct platform_device *dev)
 	return err;
 }
 
-static int efifb_remove(struct platform_device *pdev)
+static void efifb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 
 	/* efifb_destroy takes care of info cleanup */
 	unregister_framebuffer(info);
 	sysfs_remove_groups(&pdev->dev.kobj, efifb_groups);
-
-	return 0;
 }
 
 static struct platform_driver efifb_driver = {
@@ -637,7 +635,7 @@ static struct platform_driver efifb_driver = {
 		.name = "efi-framebuffer",
 	},
 	.probe = efifb_probe,
-	.remove = efifb_remove,
+	.remove_new = efifb_remove,
 };
 
 builtin_platform_driver(efifb_driver);
-- 
2.39.2


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

* [PATCH 14/51] video: fbdev: ep93xx-fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (12 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 13/51] video: fbdev: efifb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 15/51] video: fbdev: ffb: " Uwe Kleine-König
                   ` (38 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Gaosheng Cui; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/ep93xx-fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c
index 305f1587bd89..94fe52928be2 100644
--- a/drivers/video/fbdev/ep93xx-fb.c
+++ b/drivers/video/fbdev/ep93xx-fb.c
@@ -573,7 +573,7 @@ static int ep93xxfb_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int ep93xxfb_remove(struct platform_device *pdev)
+static void ep93xxfb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 	struct ep93xx_fbi *fbi = info->par;
@@ -587,13 +587,11 @@ static int ep93xxfb_remove(struct platform_device *pdev)
 		fbi->mach_info->teardown(pdev);
 
 	kfree(info);
-
-	return 0;
 }
 
 static struct platform_driver ep93xxfb_driver = {
 	.probe		= ep93xxfb_probe,
-	.remove		= ep93xxfb_remove,
+	.remove_new	= ep93xxfb_remove,
 	.driver = {
 		.name	= "ep93xx-fb",
 	},
-- 
2.39.2


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

* [PATCH 15/51] video: fbdev: ffb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (13 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 14/51] video: fbdev: ep93xx-fb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 16/51] video: fbdev: fsl-diu-fb: " Uwe Kleine-König
                   ` (37 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Wolfram Sang; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/ffb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/ffb.c b/drivers/video/fbdev/ffb.c
index 7cba3969a970..c6d3111dcbb0 100644
--- a/drivers/video/fbdev/ffb.c
+++ b/drivers/video/fbdev/ffb.c
@@ -1023,7 +1023,7 @@ static int ffb_probe(struct platform_device *op)
 	return err;
 }
 
-static int ffb_remove(struct platform_device *op)
+static void ffb_remove(struct platform_device *op)
 {
 	struct fb_info *info = dev_get_drvdata(&op->dev);
 	struct ffb_par *par = info->par;
@@ -1035,8 +1035,6 @@ static int ffb_remove(struct platform_device *op)
 	of_iounmap(&op->resource[1], par->dac, sizeof(struct ffb_dac));
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static const struct of_device_id ffb_match[] = {
@@ -1056,7 +1054,7 @@ static struct platform_driver ffb_driver = {
 		.of_match_table = ffb_match,
 	},
 	.probe		= ffb_probe,
-	.remove		= ffb_remove,
+	.remove_new	= ffb_remove,
 };
 
 static int __init ffb_init(void)
-- 
2.39.2


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

* [PATCH 16/51] video: fbdev: fsl-diu-fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (14 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 15/51] video: fbdev: ffb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 17/51] video: fbdev: gbefb: " Uwe Kleine-König
                   ` (36 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Timur Tabi, Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/fsl-diu-fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c
index e332017c6af6..730a07d23fa9 100644
--- a/drivers/video/fbdev/fsl-diu-fb.c
+++ b/drivers/video/fbdev/fsl-diu-fb.c
@@ -1823,7 +1823,7 @@ static int fsl_diu_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int fsl_diu_remove(struct platform_device *pdev)
+static void fsl_diu_remove(struct platform_device *pdev)
 {
 	struct fsl_diu_data *data;
 	int i;
@@ -1837,8 +1837,6 @@ static int fsl_diu_remove(struct platform_device *pdev)
 		uninstall_fb(&data->fsl_diu_info[i]);
 
 	iounmap(data->diu_reg);
-
-	return 0;
 }
 
 #ifndef MODULE
@@ -1885,7 +1883,7 @@ static struct platform_driver fsl_diu_driver = {
 		.of_match_table = fsl_diu_match,
 	},
 	.probe  	= fsl_diu_probe,
-	.remove 	= fsl_diu_remove,
+	.remove_new 	= fsl_diu_remove,
 	.suspend	= fsl_diu_suspend,
 	.resume		= fsl_diu_resume,
 };
-- 
2.39.2


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

* [PATCH 17/51] video: fbdev: gbefb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (15 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 16/51] video: fbdev: fsl-diu-fb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 18/51] video: fbdev: goldfishfb: " Uwe Kleine-König
                   ` (35 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Xuezhi Zhang, Jiasheng Jiang; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/gbefb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c
index 000b4aa44241..3f141e21b7e0 100644
--- a/drivers/video/fbdev/gbefb.c
+++ b/drivers/video/fbdev/gbefb.c
@@ -1233,7 +1233,7 @@ static int gbefb_probe(struct platform_device *p_dev)
 	return ret;
 }
 
-static int gbefb_remove(struct platform_device* p_dev)
+static void gbefb_remove(struct platform_device* p_dev)
 {
 	struct fb_info *info = platform_get_drvdata(p_dev);
 	struct gbefb_par *par = info->par;
@@ -1243,13 +1243,11 @@ static int gbefb_remove(struct platform_device* p_dev)
 	arch_phys_wc_del(par->wc_cookie);
 	release_mem_region(GBE_BASE, sizeof(struct sgi_gbe));
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static struct platform_driver gbefb_driver = {
 	.probe = gbefb_probe,
-	.remove = gbefb_remove,
+	.remove_new = gbefb_remove,
 	.driver	= {
 		.name = "gbefb",
 		.dev_groups	= gbefb_groups,
-- 
2.39.2


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

* [PATCH 18/51] video: fbdev: goldfishfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (16 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 17/51] video: fbdev: gbefb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 19/51] video: fbdev: grvga: " Uwe Kleine-König
                   ` (34 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/goldfishfb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c
index 2b885cd046fe..6fa2108fd912 100644
--- a/drivers/video/fbdev/goldfishfb.c
+++ b/drivers/video/fbdev/goldfishfb.c
@@ -283,7 +283,7 @@ static int goldfish_fb_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int goldfish_fb_remove(struct platform_device *pdev)
+static void goldfish_fb_remove(struct platform_device *pdev)
 {
 	size_t framesize;
 	struct goldfish_fb *fb = platform_get_drvdata(pdev);
@@ -296,7 +296,6 @@ static int goldfish_fb_remove(struct platform_device *pdev)
 						fb->fb.fix.smem_start);
 	iounmap(fb->reg_base);
 	kfree(fb);
-	return 0;
 }
 
 static const struct of_device_id goldfish_fb_of_match[] = {
@@ -315,7 +314,7 @@ MODULE_DEVICE_TABLE(acpi, goldfish_fb_acpi_match);
 
 static struct platform_driver goldfish_fb_driver = {
 	.probe		= goldfish_fb_probe,
-	.remove		= goldfish_fb_remove,
+	.remove_new	= goldfish_fb_remove,
 	.driver = {
 		.name = "goldfish_fb",
 		.of_match_table = goldfish_fb_of_match,
-- 
2.39.2


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

* [PATCH 19/51] video: fbdev: grvga: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (17 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 18/51] video: fbdev: goldfishfb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 20/51] video: fbdev: hecubafb: " Uwe Kleine-König
                   ` (33 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/grvga.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/grvga.c b/drivers/video/fbdev/grvga.c
index 24818b276241..9aa15be29ea9 100644
--- a/drivers/video/fbdev/grvga.c
+++ b/drivers/video/fbdev/grvga.c
@@ -504,7 +504,7 @@ static int grvga_probe(struct platform_device *dev)
 	return retval;
 }
 
-static int grvga_remove(struct platform_device *device)
+static void grvga_remove(struct platform_device *device)
 {
 	struct fb_info *info = dev_get_drvdata(&device->dev);
 	struct grvga_par *par;
@@ -524,8 +524,6 @@ static int grvga_remove(struct platform_device *device)
 
 		framebuffer_release(info);
 	}
-
-	return 0;
 }
 
 static struct of_device_id svgactrl_of_match[] = {
@@ -545,7 +543,7 @@ static struct platform_driver grvga_driver = {
 		.of_match_table = svgactrl_of_match,
 	},
 	.probe		= grvga_probe,
-	.remove		= grvga_remove,
+	.remove_new	= grvga_remove,
 };
 
 module_platform_driver(grvga_driver);
-- 
2.39.2


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

* [PATCH 20/51] video: fbdev: hecubafb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (18 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 19/51] video: fbdev: grvga: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 21/51] video: fbdev: hgafb: " Uwe Kleine-König
                   ` (32 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller, Javier Martinez Canillas, Thomas Zimmermann
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/hecubafb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/hecubafb.c b/drivers/video/fbdev/hecubafb.c
index eb1eaadc1bbb..5a149458d3b4 100644
--- a/drivers/video/fbdev/hecubafb.c
+++ b/drivers/video/fbdev/hecubafb.c
@@ -279,7 +279,7 @@ static int hecubafb_probe(struct platform_device *dev)
 	return retval;
 }
 
-static int hecubafb_remove(struct platform_device *dev)
+static void hecubafb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
 
@@ -293,12 +293,11 @@ static int hecubafb_remove(struct platform_device *dev)
 		module_put(par->board->owner);
 		framebuffer_release(info);
 	}
-	return 0;
 }
 
 static struct platform_driver hecubafb_driver = {
 	.probe	= hecubafb_probe,
-	.remove = hecubafb_remove,
+	.remove_new = hecubafb_remove,
 	.driver	= {
 		.name	= "hecubafb",
 	},
-- 
2.39.2


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

* [PATCH 21/51] video: fbdev: hgafb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (19 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 20/51] video: fbdev: hecubafb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:53 ` [PATCH 22/51] video: fbdev: hitfb: " Uwe Kleine-König
                   ` (31 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Ferenc Bakonyi, Helge Deller; +Cc: linux-nvidia, linux-fbdev, dri-devel, 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/video/fbdev/hgafb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c
index bd3d07aa4f0e..20bdab738ab7 100644
--- a/drivers/video/fbdev/hgafb.c
+++ b/drivers/video/fbdev/hgafb.c
@@ -595,7 +595,7 @@ static int hgafb_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int hgafb_remove(struct platform_device *pdev)
+static void hgafb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 
@@ -614,13 +614,11 @@ static int hgafb_remove(struct platform_device *pdev)
 
 	if (release_io_port)
 		release_region(0x3bf, 1);
-
-	return 0;
 }
 
 static struct platform_driver hgafb_driver = {
 	.probe = hgafb_probe,
-	.remove = hgafb_remove,
+	.remove_new = hgafb_remove,
 	.driver = {
 		.name = "hgafb",
 	},
-- 
2.39.2


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

* [PATCH 22/51] video: fbdev: hitfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (20 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 21/51] video: fbdev: hgafb: " Uwe Kleine-König
@ 2023-03-18 23:53 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 23/51] video: fbdev: imxfb: " Uwe Kleine-König
                   ` (30 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:53 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/hitfb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/hitfb.c b/drivers/video/fbdev/hitfb.c
index bbb0f1d953cc..3033f5056976 100644
--- a/drivers/video/fbdev/hitfb.c
+++ b/drivers/video/fbdev/hitfb.c
@@ -415,15 +415,13 @@ static int hitfb_probe(struct platform_device *dev)
 	return ret;
 }
 
-static int hitfb_remove(struct platform_device *dev)
+static void hitfb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
 
 	unregister_framebuffer(info);
 	fb_dealloc_cmap(&info->cmap);
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static int hitfb_suspend(struct device *dev)
@@ -460,7 +458,7 @@ static const struct dev_pm_ops hitfb_dev_pm_ops = {
 
 static struct platform_driver hitfb_driver = {
 	.probe		= hitfb_probe,
-	.remove		= hitfb_remove,
+	.remove_new	= hitfb_remove,
 	.driver		= {
 		.name	= "hitfb",
 		.pm	= &hitfb_dev_pm_ops,
-- 
2.39.2


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

* [PATCH 23/51] video: fbdev: imxfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (21 preceding siblings ...)
  2023-03-18 23:53 ` [PATCH 22/51] video: fbdev: hitfb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 24/51] video: fbdev: leo: " Uwe Kleine-König
                   ` (29 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Sascha Hauer, Helge Deller, Shawn Guo
  Cc: Fabio Estevam, NXP Linux Team, linux-fbdev, linux-arm-kernel,
	dri-devel, 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/video/fbdev/imxfb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index 51fde1b2a793..adf36690c342 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -1051,7 +1051,7 @@ static int imxfb_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int imxfb_remove(struct platform_device *pdev)
+static void imxfb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 	struct imxfb_info *fbi = info->par;
@@ -1064,8 +1064,6 @@ static int imxfb_remove(struct platform_device *pdev)
 		    fbi->map_dma);
 	kfree(info->pseudo_palette);
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static int __maybe_unused imxfb_suspend(struct device *dev)
@@ -1097,7 +1095,7 @@ static struct platform_driver imxfb_driver = {
 		.pm	= &imxfb_pm_ops,
 	},
 	.probe		= imxfb_probe,
-	.remove		= imxfb_remove,
+	.remove_new	= imxfb_remove,
 	.id_table	= imxfb_devtype,
 };
 module_platform_driver(imxfb_driver);
-- 
2.39.2


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

* [PATCH 24/51] video: fbdev: leo: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (22 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 23/51] video: fbdev: imxfb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 25/51] video: fbdev: mb862xx: " Uwe Kleine-König
                   ` (28 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/leo.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/leo.c b/drivers/video/fbdev/leo.c
index 3eb0f3583f4f..3ffc0a725f89 100644
--- a/drivers/video/fbdev/leo.c
+++ b/drivers/video/fbdev/leo.c
@@ -637,7 +637,7 @@ static int leo_probe(struct platform_device *op)
 	return err;
 }
 
-static int leo_remove(struct platform_device *op)
+static void leo_remove(struct platform_device *op)
 {
 	struct fb_info *info = dev_get_drvdata(&op->dev);
 	struct leo_par *par = info->par;
@@ -648,8 +648,6 @@ static int leo_remove(struct platform_device *op)
 	leo_unmap_regs(op, info, par);
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static const struct of_device_id leo_match[] = {
@@ -666,7 +664,7 @@ static struct platform_driver leo_driver = {
 		.of_match_table = leo_match,
 	},
 	.probe		= leo_probe,
-	.remove		= leo_remove,
+	.remove_new	= leo_remove,
 };
 
 static int __init leo_init(void)
-- 
2.39.2


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

* [PATCH 25/51] video: fbdev: mb862xx: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (23 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 24/51] video: fbdev: leo: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 26/51] video: fbdev: metronomefb: " Uwe Kleine-König
                   ` (27 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Christophe Leroy, Javier Martinez Canillas,
	Thomas Zimmermann
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/mb862xx/mb862xxfbdrv.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
index a236fc910148..b5c8fcab9940 100644
--- a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
@@ -784,7 +784,7 @@ static int of_platform_mb862xx_probe(struct platform_device *ofdev)
 	return ret;
 }
 
-static int of_platform_mb862xx_remove(struct platform_device *ofdev)
+static void of_platform_mb862xx_remove(struct platform_device *ofdev)
 {
 	struct fb_info *fbi = dev_get_drvdata(&ofdev->dev);
 	struct mb862xxfb_par *par = fbi->par;
@@ -814,7 +814,6 @@ static int of_platform_mb862xx_remove(struct platform_device *ofdev)
 
 	release_mem_region(par->res->start, res_size);
 	framebuffer_release(fbi);
-	return 0;
 }
 
 /*
@@ -838,7 +837,7 @@ static struct platform_driver of_platform_mb862xxfb_driver = {
 		.of_match_table = of_platform_mb862xx_tbl,
 	},
 	.probe		= of_platform_mb862xx_probe,
-	.remove		= of_platform_mb862xx_remove,
+	.remove_new	= of_platform_mb862xx_remove,
 };
 #endif
 
-- 
2.39.2


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

* [PATCH 26/51] video: fbdev: metronomefb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (24 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 25/51] video: fbdev: mb862xx: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 27/51] video: fbdev: mx3fb: " Uwe Kleine-König
                   ` (26 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Thomas Zimmermann, Javier Martinez Canillas
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/metronomefb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/metronomefb.c b/drivers/video/fbdev/metronomefb.c
index 9fd4bb85d735..bbdbf463f0c8 100644
--- a/drivers/video/fbdev/metronomefb.c
+++ b/drivers/video/fbdev/metronomefb.c
@@ -744,7 +744,7 @@ static int metronomefb_probe(struct platform_device *dev)
 	return retval;
 }
 
-static int metronomefb_remove(struct platform_device *dev)
+static void metronomefb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
 
@@ -761,12 +761,11 @@ static int metronomefb_remove(struct platform_device *dev)
 		dev_dbg(&dev->dev, "calling release\n");
 		framebuffer_release(info);
 	}
-	return 0;
 }
 
 static struct platform_driver metronomefb_driver = {
 	.probe	= metronomefb_probe,
-	.remove = metronomefb_remove,
+	.remove_new = metronomefb_remove,
 	.driver	= {
 		.name	= "metronomefb",
 	},
-- 
2.39.2


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

* [PATCH 27/51] video: fbdev: mx3fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (25 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 26/51] video: fbdev: metronomefb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 28/51] video: fbdev: ocfb: " Uwe Kleine-König
                   ` (25 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Stephen Kitt, Daniel Thompson, Mark Brown, Sascha Hauer
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/mx3fb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index 76771e126d0a..63c186e0364a 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -1616,7 +1616,7 @@ static int mx3fb_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mx3fb_remove(struct platform_device *dev)
+static void mx3fb_remove(struct platform_device *dev)
 {
 	struct mx3fb_data *mx3fb = platform_get_drvdata(dev);
 	struct fb_info *fbi = mx3fb->fbi;
@@ -1632,7 +1632,6 @@ static int mx3fb_remove(struct platform_device *dev)
 	dmaengine_put();
 
 	iounmap(mx3fb->reg_base);
-	return 0;
 }
 
 static struct platform_driver mx3fb_driver = {
@@ -1640,7 +1639,7 @@ static struct platform_driver mx3fb_driver = {
 		.name = MX3FB_NAME,
 	},
 	.probe = mx3fb_probe,
-	.remove = mx3fb_remove,
+	.remove_new = mx3fb_remove,
 	.suspend = mx3fb_suspend,
 	.resume = mx3fb_resume,
 };
-- 
2.39.2


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

* [PATCH 28/51] video: fbdev: ocfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (26 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 27/51] video: fbdev: mx3fb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 29/51] video: fbdev: offb: " Uwe Kleine-König
                   ` (24 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/ocfb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/ocfb.c b/drivers/video/fbdev/ocfb.c
index da7e1457e58f..7ebe794583e1 100644
--- a/drivers/video/fbdev/ocfb.c
+++ b/drivers/video/fbdev/ocfb.c
@@ -370,7 +370,7 @@ static int ocfb_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int ocfb_remove(struct platform_device *pdev)
+static void ocfb_remove(struct platform_device *pdev)
 {
 	struct ocfb_dev *fbdev = platform_get_drvdata(pdev);
 
@@ -383,8 +383,6 @@ static int ocfb_remove(struct platform_device *pdev)
 	ocfb_writereg(fbdev, OCFB_CTRL, 0);
 
 	platform_set_drvdata(pdev, NULL);
-
-	return 0;
 }
 
 static const struct of_device_id ocfb_match[] = {
@@ -395,7 +393,7 @@ MODULE_DEVICE_TABLE(of, ocfb_match);
 
 static struct platform_driver ocfb_driver = {
 	.probe  = ocfb_probe,
-	.remove	= ocfb_remove,
+	.remove_new = ocfb_remove,
 	.driver = {
 		.name = "ocfb_fb",
 		.of_match_table = ocfb_match,
-- 
2.39.2


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

* [PATCH 29/51] video: fbdev: offb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (27 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 28/51] video: fbdev: ocfb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 30/51] video: fbdev: omapfb: " Uwe Kleine-König
                   ` (23 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Javier Martinez Canillas, Thomas Zimmermann,
	Rob Herring, Christophe Leroy
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/offb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
index f7ad6bc9d02d..b18d8c851918 100644
--- a/drivers/video/fbdev/offb.c
+++ b/drivers/video/fbdev/offb.c
@@ -658,14 +658,12 @@ static void offb_init_nodriver(struct platform_device *parent, struct device_nod
 	}
 }
 
-static int offb_remove(struct platform_device *pdev)
+static void offb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 
 	if (info)
 		unregister_framebuffer(info);
-
-	return 0;
 }
 
 static int offb_probe_bootx_noscreen(struct platform_device *pdev)
@@ -680,7 +678,7 @@ static struct platform_driver offb_driver_bootx_noscreen = {
 		.name = "bootx-noscreen",
 	},
 	.probe = offb_probe_bootx_noscreen,
-	.remove = offb_remove,
+	.remove_new = offb_remove,
 };
 
 static int offb_probe_display(struct platform_device *pdev)
@@ -702,7 +700,7 @@ static struct platform_driver offb_driver_display = {
 		.of_match_table = offb_of_match_display,
 	},
 	.probe = offb_probe_display,
-	.remove = offb_remove,
+	.remove_new = offb_remove,
 };
 
 static int __init offb_init(void)
-- 
2.39.2


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

* [PATCH 30/51] video: fbdev: omapfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (28 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 29/51] video: fbdev: offb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 31/51] video: fbdev: p9100: " Uwe Kleine-König
                   ` (22 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Bartlomiej Zolnierkiewicz, Arnd Bergmann,
	Tony Lindgren, Jiapeng Chong, Yu Zhe, Xu Panda, Zhang Qilong,
	Wolfram Sang
  Cc: linux-fbdev, linux-omap, dri-devel, 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/video/fbdev/omap/omapfb_main.c         | 6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/core.c    | 6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/dispc.c   | 5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c     | 5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c     | 5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/dss.c     | 5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c   | 5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c   | 5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c     | 5 ++---
 drivers/video/fbdev/omap2/omapfb/dss/venc.c    | 5 ++---
 drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 6 ++----
 11 files changed, 22 insertions(+), 36 deletions(-)

diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
index 1f3df2055ff0..764058f40341 100644
--- a/drivers/video/fbdev/omap/omapfb_main.c
+++ b/drivers/video/fbdev/omap/omapfb_main.c
@@ -1793,7 +1793,7 @@ void omapfb_register_panel(struct lcd_panel *panel)
 EXPORT_SYMBOL_GPL(omapfb_register_panel);
 
 /* Called when the device is being detached from the driver */
-static int omapfb_remove(struct platform_device *pdev)
+static void omapfb_remove(struct platform_device *pdev)
 {
 	struct omapfb_device *fbdev = platform_get_drvdata(pdev);
 	enum omapfb_state saved_state = fbdev->state;
@@ -1805,8 +1805,6 @@ static int omapfb_remove(struct platform_device *pdev)
 
 	platform_device_unregister(&omapdss_device);
 	fbdev->dssdev = NULL;
-
-	return 0;
 }
 
 /* PM suspend */
@@ -1831,7 +1829,7 @@ static int omapfb_resume(struct platform_device *pdev)
 
 static struct platform_driver omapfb_driver = {
 	.probe		= omapfb_probe,
-	.remove		= omapfb_remove,
+	.remove_new	= omapfb_remove,
 	.suspend	= omapfb_suspend,
 	.resume		= omapfb_resume,
 	.driver		= {
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/core.c b/drivers/video/fbdev/omap2/omapfb/dss/core.c
index 37858be8be83..5fbd8885bad8 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/core.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/core.c
@@ -171,13 +171,11 @@ static int __init omap_dss_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int omap_dss_remove(struct platform_device *pdev)
+static void omap_dss_remove(struct platform_device *pdev)
 {
 	unregister_pm_notifier(&omap_dss_pm_notif_block);
 
 	dss_uninitialize_debugfs();
-
-	return 0;
 }
 
 static void omap_dss_shutdown(struct platform_device *pdev)
@@ -187,7 +185,7 @@ static void omap_dss_shutdown(struct platform_device *pdev)
 }
 
 static struct platform_driver omap_dss_driver = {
-	.remove         = omap_dss_remove,
+	.remove_new     = omap_dss_remove,
 	.shutdown	= omap_dss_shutdown,
 	.driver         = {
 		.name   = "omapdss",
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
index 92fb6b7e1f68..21fef9db90d2 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
@@ -4017,10 +4017,9 @@ static int dispc_probe(struct platform_device *pdev)
 	return component_add(&pdev->dev, &dispc_component_ops);
 }
 
-static int dispc_remove(struct platform_device *pdev)
+static void dispc_remove(struct platform_device *pdev)
 {
 	component_del(&pdev->dev, &dispc_component_ops);
-	return 0;
 }
 
 static int dispc_runtime_suspend(struct device *dev)
@@ -4073,7 +4072,7 @@ static const struct of_device_id dispc_of_match[] = {
 
 static struct platform_driver omap_dispchw_driver = {
 	.probe		= dispc_probe,
-	.remove         = dispc_remove,
+	.remove_new     = dispc_remove,
 	.driver         = {
 		.name   = "omapdss_dispc",
 		.pm	= &dispc_pm_ops,
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
index 99ce6e955a46..7c1b7d89389a 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
@@ -810,15 +810,14 @@ static int dpi_probe(struct platform_device *pdev)
 	return component_add(&pdev->dev, &dpi_component_ops);
 }
 
-static int dpi_remove(struct platform_device *pdev)
+static void dpi_remove(struct platform_device *pdev)
 {
 	component_del(&pdev->dev, &dpi_component_ops);
-	return 0;
 }
 
 static struct platform_driver omap_dpi_driver = {
 	.probe		= dpi_probe,
-	.remove		= dpi_remove,
+	.remove_new	= dpi_remove,
 	.driver         = {
 		.name   = "omapdss_dpi",
 		.suppress_bind_attrs = true,
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index 7cddb7b8ae34..b7eb17a16ec4 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -5495,10 +5495,9 @@ static int dsi_probe(struct platform_device *pdev)
 	return component_add(&pdev->dev, &dsi_component_ops);
 }
 
-static int dsi_remove(struct platform_device *pdev)
+static void dsi_remove(struct platform_device *pdev)
 {
 	component_del(&pdev->dev, &dsi_component_ops);
-	return 0;
 }
 
 static int dsi_runtime_suspend(struct device *dev)
@@ -5565,7 +5564,7 @@ static const struct of_device_id dsi_of_match[] = {
 
 static struct platform_driver omap_dsihw_driver = {
 	.probe		= dsi_probe,
-	.remove		= dsi_remove,
+	.remove_new	= dsi_remove,
 	.driver         = {
 		.name   = "omapdss_dsi",
 		.pm	= &dsi_pm_ops,
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
index 335e0af4eec1..d814e4baa4b3 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
@@ -1224,10 +1224,9 @@ static int dss_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int dss_remove(struct platform_device *pdev)
+static void dss_remove(struct platform_device *pdev)
 {
 	component_master_del(&pdev->dev, &dss_component_ops);
-	return 0;
 }
 
 static int dss_runtime_suspend(struct device *dev)
@@ -1279,7 +1278,7 @@ MODULE_DEVICE_TABLE(of, dss_of_match);
 
 static struct platform_driver omap_dsshw_driver = {
 	.probe		= dss_probe,
-	.remove		= dss_remove,
+	.remove_new	= dss_remove,
 	.driver         = {
 		.name   = "omapdss_dss",
 		.pm	= &dss_pm_ops,
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
index 0f39612e002e..f05b4e35a842 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
@@ -756,10 +756,9 @@ static int hdmi4_probe(struct platform_device *pdev)
 	return component_add(&pdev->dev, &hdmi4_component_ops);
 }
 
-static int hdmi4_remove(struct platform_device *pdev)
+static void hdmi4_remove(struct platform_device *pdev)
 {
 	component_del(&pdev->dev, &hdmi4_component_ops);
-	return 0;
 }
 
 static int hdmi_runtime_suspend(struct device *dev)
@@ -792,7 +791,7 @@ static const struct of_device_id hdmi_of_match[] = {
 
 static struct platform_driver omapdss_hdmihw_driver = {
 	.probe		= hdmi4_probe,
-	.remove		= hdmi4_remove,
+	.remove_new	= hdmi4_remove,
 	.driver         = {
 		.name   = "omapdss_hdmi",
 		.pm	= &hdmi_pm_ops,
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
index bfccc2cb917a..03292945b1d4 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
@@ -797,10 +797,9 @@ static int hdmi5_probe(struct platform_device *pdev)
 	return component_add(&pdev->dev, &hdmi5_component_ops);
 }
 
-static int hdmi5_remove(struct platform_device *pdev)
+static void hdmi5_remove(struct platform_device *pdev)
 {
 	component_del(&pdev->dev, &hdmi5_component_ops);
-	return 0;
 }
 
 static int hdmi_runtime_suspend(struct device *dev)
@@ -834,7 +833,7 @@ static const struct of_device_id hdmi_of_match[] = {
 
 static struct platform_driver omapdss_hdmihw_driver = {
 	.probe		= hdmi5_probe,
-	.remove		= hdmi5_remove,
+	.remove_new	= hdmi5_remove,
 	.driver         = {
 		.name   = "omapdss_hdmi5",
 		.pm	= &hdmi_pm_ops,
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
index 002f07f5480f..d527931b2b16 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
@@ -375,15 +375,14 @@ static int sdi_probe(struct platform_device *pdev)
 	return component_add(&pdev->dev, &sdi_component_ops);
 }
 
-static int sdi_remove(struct platform_device *pdev)
+static void sdi_remove(struct platform_device *pdev)
 {
 	component_del(&pdev->dev, &sdi_component_ops);
-	return 0;
 }
 
 static struct platform_driver omap_sdi_driver = {
 	.probe		= sdi_probe,
-	.remove         = sdi_remove,
+	.remove_new     = sdi_remove,
 	.driver         = {
 		.name   = "omapdss_sdi",
 		.suppress_bind_attrs = true,
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
index 78a7309d25dd..c9d40e28a06f 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
@@ -880,10 +880,9 @@ static int venc_probe(struct platform_device *pdev)
 	return component_add(&pdev->dev, &venc_component_ops);
 }
 
-static int venc_remove(struct platform_device *pdev)
+static void venc_remove(struct platform_device *pdev)
 {
 	component_del(&pdev->dev, &venc_component_ops);
-	return 0;
 }
 
 static int venc_runtime_suspend(struct device *dev)
@@ -922,7 +921,7 @@ static const struct of_device_id venc_of_match[] = {
 
 static struct platform_driver omap_venchw_driver = {
 	.probe		= venc_probe,
-	.remove		= venc_remove,
+	.remove_new	= venc_remove,
 	.driver         = {
 		.name   = "omapdss_venc",
 		.pm	= &venc_pm_ops,
diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
index 5ccddcfce722..c0538069eb48 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
@@ -2599,7 +2599,7 @@ static int omapfb_probe(struct platform_device *pdev)
 	return r;
 }
 
-static int omapfb_remove(struct platform_device *pdev)
+static void omapfb_remove(struct platform_device *pdev)
 {
 	struct omapfb2_device *fbdev = platform_get_drvdata(pdev);
 
@@ -2610,13 +2610,11 @@ static int omapfb_remove(struct platform_device *pdev)
 	omapfb_free_resources(fbdev);
 
 	omapdss_compat_uninit();
-
-	return 0;
 }
 
 static struct platform_driver omapfb_driver = {
 	.probe		= omapfb_probe,
-	.remove         = omapfb_remove,
+	.remove_new     = omapfb_remove,
 	.driver         = {
 		.name   = "omapfb",
 	},
-- 
2.39.2


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

* [PATCH 31/51] video: fbdev: p9100: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (29 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 30/51] video: fbdev: omapfb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 32/51] video: fbdev: platinumfb: " Uwe Kleine-König
                   ` (21 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/p9100.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/p9100.c b/drivers/video/fbdev/p9100.c
index 4e88a0a195ad..3e44f9516318 100644
--- a/drivers/video/fbdev/p9100.c
+++ b/drivers/video/fbdev/p9100.c
@@ -327,7 +327,7 @@ static int p9100_probe(struct platform_device *op)
 	return err;
 }
 
-static int p9100_remove(struct platform_device *op)
+static void p9100_remove(struct platform_device *op)
 {
 	struct fb_info *info = dev_get_drvdata(&op->dev);
 	struct p9100_par *par = info->par;
@@ -339,8 +339,6 @@ static int p9100_remove(struct platform_device *op)
 	of_iounmap(&op->resource[2], info->screen_base, info->fix.smem_len);
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static const struct of_device_id p9100_match[] = {
@@ -357,7 +355,7 @@ static struct platform_driver p9100_driver = {
 		.of_match_table = p9100_match,
 	},
 	.probe		= p9100_probe,
-	.remove		= p9100_remove,
+	.remove_new	= p9100_remove,
 };
 
 static int __init p9100_init(void)
-- 
2.39.2


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

* [PATCH 32/51] video: fbdev: platinumfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (30 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 31/51] video: fbdev: p9100: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 33/51] video: fbdev: pxa168fb: " Uwe Kleine-König
                   ` (20 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Christophe Leroy; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/platinumfb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/platinumfb.c b/drivers/video/fbdev/platinumfb.c
index 5b9e26ea6449..82f019f0a0d6 100644
--- a/drivers/video/fbdev/platinumfb.c
+++ b/drivers/video/fbdev/platinumfb.c
@@ -636,7 +636,7 @@ static int platinumfb_probe(struct platform_device* odev)
 	return rc;
 }
 
-static int platinumfb_remove(struct platform_device* odev)
+static void platinumfb_remove(struct platform_device* odev)
 {
 	struct fb_info		*info = dev_get_drvdata(&odev->dev);
 	struct fb_info_platinum	*pinfo = info->par;
@@ -654,8 +654,6 @@ static int platinumfb_remove(struct platform_device* odev)
 	release_mem_region(pinfo->cmap_regs_phys, 0x1000);
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static struct of_device_id platinumfb_match[] = 
@@ -673,7 +671,7 @@ static struct platform_driver platinum_driver =
 		.of_match_table = platinumfb_match,
 	},
 	.probe		= platinumfb_probe,
-	.remove		= platinumfb_remove,
+	.remove_new	= platinumfb_remove,
 };
 
 static int __init platinumfb_init(void)
-- 
2.39.2


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

* [PATCH 33/51] video: fbdev: pxa168fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (31 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 32/51] video: fbdev: platinumfb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 34/51] video: fbdev: pxa3xx-gcu: " Uwe Kleine-König
                   ` (19 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Wolfram Sang; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/pxa168fb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c
index d5d0bbd39213..79f338463092 100644
--- a/drivers/video/fbdev/pxa168fb.c
+++ b/drivers/video/fbdev/pxa168fb.c
@@ -765,14 +765,14 @@ static int pxa168fb_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pxa168fb_remove(struct platform_device *pdev)
+static void pxa168fb_remove(struct platform_device *pdev)
 {
 	struct pxa168fb_info *fbi = platform_get_drvdata(pdev);
 	struct fb_info *info;
 	unsigned int data;
 
 	if (!fbi)
-		return 0;
+		return;
 
 	/* disable DMA transfer */
 	data = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0);
@@ -794,8 +794,6 @@ static int pxa168fb_remove(struct platform_device *pdev)
 	clk_disable_unprepare(fbi->clk);
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static struct platform_driver pxa168fb_driver = {
@@ -803,7 +801,7 @@ static struct platform_driver pxa168fb_driver = {
 		.name	= "pxa168-fb",
 	},
 	.probe		= pxa168fb_probe,
-	.remove		= pxa168fb_remove,
+	.remove_new	= pxa168fb_remove,
 };
 
 module_platform_driver(pxa168fb_driver);
-- 
2.39.2


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

* [PATCH 34/51] video: fbdev: pxa3xx-gcu: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (32 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 33/51] video: fbdev: pxa168fb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 35/51] video: fbdev: pxafb: " Uwe Kleine-König
                   ` (18 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Hyunwoo Kim, Yang Yingliang; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/pxa3xx-gcu.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index c3cd1e1cc01b..2b6ec8c66074 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -676,7 +676,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pxa3xx_gcu_remove(struct platform_device *pdev)
+static void pxa3xx_gcu_remove(struct platform_device *pdev)
 {
 	struct pxa3xx_gcu_priv *priv = platform_get_drvdata(pdev);
 	struct device *dev = &pdev->dev;
@@ -686,8 +686,6 @@ static int pxa3xx_gcu_remove(struct platform_device *pdev)
 	dma_free_coherent(dev, SHARED_SIZE, priv->shared, priv->shared_phys);
 	clk_disable_unprepare(priv->clk);
 	pxa3xx_gcu_free_buffers(dev, priv);
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -700,7 +698,7 @@ MODULE_DEVICE_TABLE(of, pxa3xx_gcu_of_match);
 
 static struct platform_driver pxa3xx_gcu_driver = {
 	.probe	  = pxa3xx_gcu_probe,
-	.remove	 = pxa3xx_gcu_remove,
+	.remove_new	 = pxa3xx_gcu_remove,
 	.driver	 = {
 		.name   = DRV_NAME,
 		.of_match_table = of_match_ptr(pxa3xx_gcu_of_match),
-- 
2.39.2


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

* [PATCH 35/51] video: fbdev: pxafb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (33 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 34/51] video: fbdev: pxa3xx-gcu: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 36/51] video: fbdev: s1d13xxxfb: " Uwe Kleine-König
                   ` (17 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Arnd Bergmann, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Ulf Hansson, wangkailong, Wang Qing,
	Wolfram Sang
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/pxafb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index c46ed78298ae..2a8b1dea3a67 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2396,13 +2396,13 @@ static int pxafb_probe(struct platform_device *dev)
 	return ret;
 }
 
-static int pxafb_remove(struct platform_device *dev)
+static void pxafb_remove(struct platform_device *dev)
 {
 	struct pxafb_info *fbi = platform_get_drvdata(dev);
 	struct fb_info *info;
 
 	if (!fbi)
-		return 0;
+		return;
 
 	info = &fbi->fb;
 
@@ -2418,8 +2418,6 @@ static int pxafb_remove(struct platform_device *dev)
 
 	dma_free_coherent(&dev->dev, fbi->dma_buff_size, fbi->dma_buff,
 			  fbi->dma_buff_phys);
-
-	return 0;
 }
 
 static const struct of_device_id pxafb_of_dev_id[] = {
@@ -2432,7 +2430,7 @@ MODULE_DEVICE_TABLE(of, pxafb_of_dev_id);
 
 static struct platform_driver pxafb_driver = {
 	.probe		= pxafb_probe,
-	.remove 	= pxafb_remove,
+	.remove_new 	= pxafb_remove,
 	.driver		= {
 		.name	= "pxa2xx-fb",
 		.of_match_table = pxafb_of_dev_id,
-- 
2.39.2


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

* [PATCH 36/51] video: fbdev: s1d13xxxfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (34 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 35/51] video: fbdev: pxafb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 37/51] video: fbdev: s3c-fb: " Uwe Kleine-König
                   ` (16 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Kristoffer Ericson, Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/s1d13xxxfb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/s1d13xxxfb.c b/drivers/video/fbdev/s1d13xxxfb.c
index d1b5f965bc96..8f2edccdba46 100644
--- a/drivers/video/fbdev/s1d13xxxfb.c
+++ b/drivers/video/fbdev/s1d13xxxfb.c
@@ -748,13 +748,12 @@ static void __s1d13xxxfb_remove(struct platform_device *pdev)
 			   resource_size(&pdev->resource[1]));
 }
 
-static int s1d13xxxfb_remove(struct platform_device *pdev)
+static void s1d13xxxfb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 
 	unregister_framebuffer(info);
 	__s1d13xxxfb_remove(pdev);
-	return 0;
 }
 
 static int s1d13xxxfb_probe(struct platform_device *pdev)
@@ -995,7 +994,7 @@ static int s1d13xxxfb_resume(struct platform_device *dev)
 
 static struct platform_driver s1d13xxxfb_driver = {
 	.probe		= s1d13xxxfb_probe,
-	.remove		= s1d13xxxfb_remove,
+	.remove_new	= s1d13xxxfb_remove,
 #ifdef CONFIG_PM
 	.suspend	= s1d13xxxfb_suspend,
 	.resume		= s1d13xxxfb_resume,
-- 
2.39.2


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

* [PATCH 37/51] video: fbdev: s3c-fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (35 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 36/51] video: fbdev: s1d13xxxfb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 38/51] video: fbdev: sh7760fb: " Uwe Kleine-König
                   ` (15 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Jingoo Han, Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/s3c-fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
index 3abbc5737c3b..1ce707e4cfd0 100644
--- a/drivers/video/fbdev/s3c-fb.c
+++ b/drivers/video/fbdev/s3c-fb.c
@@ -1507,7 +1507,7 @@ static int s3c_fb_probe(struct platform_device *pdev)
  * Shutdown and then release all the resources that the driver allocated
  * on initialisation.
  */
-static int s3c_fb_remove(struct platform_device *pdev)
+static void s3c_fb_remove(struct platform_device *pdev)
 {
 	struct s3c_fb *sfb = platform_get_drvdata(pdev);
 	int win;
@@ -1525,8 +1525,6 @@ static int s3c_fb_remove(struct platform_device *pdev)
 
 	pm_runtime_put_sync(sfb->dev);
 	pm_runtime_disable(sfb->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -1794,7 +1792,7 @@ static const struct dev_pm_ops s3cfb_pm_ops = {
 
 static struct platform_driver s3c_fb_driver = {
 	.probe		= s3c_fb_probe,
-	.remove		= s3c_fb_remove,
+	.remove_new	= s3c_fb_remove,
 	.id_table	= s3c_fb_driver_ids,
 	.driver		= {
 		.name	= "s3c-fb",
-- 
2.39.2


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

* [PATCH 38/51] video: fbdev: sh7760fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (36 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 37/51] video: fbdev: s3c-fb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 39/51] video: fbdev: sh_mobile_lcdcfb: " Uwe Kleine-König
                   ` (14 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/sh7760fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/sh7760fb.c b/drivers/video/fbdev/sh7760fb.c
index 5978a8921232..768011bdb430 100644
--- a/drivers/video/fbdev/sh7760fb.c
+++ b/drivers/video/fbdev/sh7760fb.c
@@ -554,7 +554,7 @@ static int sh7760fb_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sh7760fb_remove(struct platform_device *dev)
+static void sh7760fb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
 	struct sh7760fb_par *par = info->par;
@@ -568,8 +568,6 @@ static int sh7760fb_remove(struct platform_device *dev)
 	iounmap(par->base);
 	release_mem_region(par->ioarea->start, resource_size(par->ioarea));
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static struct platform_driver sh7760_lcdc_driver = {
@@ -577,7 +575,7 @@ static struct platform_driver sh7760_lcdc_driver = {
 		   .name = "sh7760-lcdc",
 		   },
 	.probe = sh7760fb_probe,
-	.remove = sh7760fb_remove,
+	.remove_new = sh7760fb_remove,
 };
 
 module_platform_driver(sh7760_lcdc_driver);
-- 
2.39.2


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

* [PATCH 39/51] video: fbdev: sh_mobile_lcdcfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (37 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 38/51] video: fbdev: sh7760fb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-19  9:16   ` Geert Uytterhoeven
  2023-03-18 23:54 ` [PATCH 40/51] video: fbdev: simplefb: " Uwe Kleine-König
                   ` (13 subsequent siblings)
  52 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Thomas Zimmermann, Javier Martinez Canillas,
	ye xingchen, Geert Uytterhoeven
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/sh_mobile_lcdcfb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index ad9323ed8e2e..093f035d1246 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -2249,7 +2249,7 @@ static const struct fb_videomode default_720p = {
 	.sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
 };
 
-static int sh_mobile_lcdc_remove(struct platform_device *pdev)
+static void sh_mobile_lcdc_remove(struct platform_device *pdev)
 {
 	struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev);
 	unsigned int i;
@@ -2305,7 +2305,6 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
 	if (priv->irq)
 		free_irq(priv->irq, priv);
 	kfree(priv);
-	return 0;
 }
 
 static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch)
@@ -2656,7 +2655,7 @@ static struct platform_driver sh_mobile_lcdc_driver = {
 		.pm		= &sh_mobile_lcdc_dev_pm_ops,
 	},
 	.probe		= sh_mobile_lcdc_probe,
-	.remove		= sh_mobile_lcdc_remove,
+	.remove_new	= sh_mobile_lcdc_remove,
 };
 
 module_platform_driver(sh_mobile_lcdc_driver);
-- 
2.39.2


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

* [PATCH 40/51] video: fbdev: simplefb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (38 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 39/51] video: fbdev: sh_mobile_lcdcfb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 41/51] video: fbdev: sm501fb: " Uwe Kleine-König
                   ` (12 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Hans de Goede, Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/simplefb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index 10d71879d340..e4a13871bca6 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -538,14 +538,12 @@ static int simplefb_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int simplefb_remove(struct platform_device *pdev)
+static void simplefb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 
 	/* simplefb_destroy takes care of info cleanup */
 	unregister_framebuffer(info);
-
-	return 0;
 }
 
 static const struct of_device_id simplefb_of_match[] = {
@@ -560,7 +558,7 @@ static struct platform_driver simplefb_driver = {
 		.of_match_table = simplefb_of_match,
 	},
 	.probe = simplefb_probe,
-	.remove = simplefb_remove,
+	.remove_new = simplefb_remove,
 };
 
 module_platform_driver(simplefb_driver);
-- 
2.39.2


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

* [PATCH 41/51] video: fbdev: sm501fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (39 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 40/51] video: fbdev: simplefb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 42/51] video: fbdev: tcx: " Uwe Kleine-König
                   ` (11 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Wolfram Sang, Xuezhi Zhang; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/sm501fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index f743bfbde2a6..9a95c21203ce 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -2045,7 +2045,7 @@ static int sm501fb_probe(struct platform_device *pdev)
 /*
  *  Cleanup
  */
-static int sm501fb_remove(struct platform_device *pdev)
+static void sm501fb_remove(struct platform_device *pdev)
 {
 	struct sm501fb_info *info = platform_get_drvdata(pdev);
 	struct fb_info	   *fbinfo_crt = info->fb[0];
@@ -2064,8 +2064,6 @@ static int sm501fb_remove(struct platform_device *pdev)
 
 	framebuffer_release(fbinfo_pnl);
 	framebuffer_release(fbinfo_crt);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -2209,7 +2207,7 @@ static int sm501fb_resume(struct platform_device *pdev)
 
 static struct platform_driver sm501fb_driver = {
 	.probe		= sm501fb_probe,
-	.remove		= sm501fb_remove,
+	.remove_new	= sm501fb_remove,
 	.suspend	= sm501fb_suspend,
 	.resume		= sm501fb_resume,
 	.driver		= {
-- 
2.39.2


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

* [PATCH 42/51] video: fbdev: tcx: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (40 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 41/51] video: fbdev: sm501fb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 43/51] video: fbdev: uvesafb: " Uwe Kleine-König
                   ` (10 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Wolfram Sang; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/tcx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/tcx.c b/drivers/video/fbdev/tcx.c
index 01d87f53324d..30a460b6f204 100644
--- a/drivers/video/fbdev/tcx.c
+++ b/drivers/video/fbdev/tcx.c
@@ -487,7 +487,7 @@ static int tcx_probe(struct platform_device *op)
 	return err;
 }
 
-static int tcx_remove(struct platform_device *op)
+static void tcx_remove(struct platform_device *op)
 {
 	struct fb_info *info = dev_get_drvdata(&op->dev);
 	struct tcx_par *par = info->par;
@@ -498,8 +498,6 @@ static int tcx_remove(struct platform_device *op)
 	tcx_unmap_regs(op, info, par);
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static const struct of_device_id tcx_match[] = {
@@ -516,7 +514,7 @@ static struct platform_driver tcx_driver = {
 		.of_match_table = tcx_match,
 	},
 	.probe		= tcx_probe,
-	.remove		= tcx_remove,
+	.remove_new	= tcx_remove,
 };
 
 static int __init tcx_init(void)
-- 
2.39.2


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

* [PATCH 43/51] video: fbdev: uvesafb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (41 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 42/51] video: fbdev: tcx: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 44/51] video: fbdev: vesafb: " Uwe Kleine-König
                   ` (9 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Michal Januszewski, Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/uvesafb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index f09f483c219b..78d85dae8ec8 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -1774,7 +1774,7 @@ static int uvesafb_probe(struct platform_device *dev)
 	return err;
 }
 
-static int uvesafb_remove(struct platform_device *dev)
+static void uvesafb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
 	struct uvesafb_par *par = info->par;
@@ -1793,13 +1793,11 @@ static int uvesafb_remove(struct platform_device *dev)
 	kfree(par->vbe_state_saved);
 
 	framebuffer_release(info);
-
-	return 0;
 }
 
 static struct platform_driver uvesafb_driver = {
 	.probe  = uvesafb_probe,
-	.remove = uvesafb_remove,
+	.remove_new = uvesafb_remove,
 	.driver = {
 		.name = "uvesafb",
 	},
-- 
2.39.2


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

* [PATCH 44/51] video: fbdev: vesafb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (42 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 43/51] video: fbdev: uvesafb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 45/51] video: fbdev: vfb: " Uwe Kleine-König
                   ` (8 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Javier Martinez Canillas, Thomas Zimmermann, Daniel Vetter
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/vesafb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c
index 3f8bdfcf51f0..7451c607dc50 100644
--- a/drivers/video/fbdev/vesafb.c
+++ b/drivers/video/fbdev/vesafb.c
@@ -485,7 +485,7 @@ static int vesafb_probe(struct platform_device *dev)
 	return err;
 }
 
-static int vesafb_remove(struct platform_device *pdev)
+static void vesafb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 
@@ -494,8 +494,6 @@ static int vesafb_remove(struct platform_device *pdev)
 
 	/* vesafb_destroy takes care of info cleanup */
 	unregister_framebuffer(info);
-
-	return 0;
 }
 
 static struct platform_driver vesafb_driver = {
@@ -503,7 +501,7 @@ static struct platform_driver vesafb_driver = {
 		.name = "vesa-framebuffer",
 	},
 	.probe = vesafb_probe,
-	.remove = vesafb_remove,
+	.remove_new = vesafb_remove,
 };
 
 module_platform_driver(vesafb_driver);
-- 
2.39.2


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

* [PATCH 45/51] video: fbdev: vfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (43 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 44/51] video: fbdev: vesafb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 46/51] video: fbdev: vga16fb: " Uwe Kleine-König
                   ` (7 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/vfb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/vfb.c b/drivers/video/fbdev/vfb.c
index 95d3c59867d0..1a2514d564fc 100644
--- a/drivers/video/fbdev/vfb.c
+++ b/drivers/video/fbdev/vfb.c
@@ -479,7 +479,7 @@ static int vfb_probe(struct platform_device *dev)
 	return retval;
 }
 
-static int vfb_remove(struct platform_device *dev)
+static void vfb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
 
@@ -489,12 +489,11 @@ static int vfb_remove(struct platform_device *dev)
 		fb_dealloc_cmap(&info->cmap);
 		framebuffer_release(info);
 	}
-	return 0;
 }
 
 static struct platform_driver vfb_driver = {
 	.probe	= vfb_probe,
-	.remove = vfb_remove,
+	.remove_new = vfb_remove,
 	.driver = {
 		.name	= "vfb",
 	},
-- 
2.39.2


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

* [PATCH 46/51] video: fbdev: vga16fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (44 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 45/51] video: fbdev: vfb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 47/51] video: fbdev: via: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Javier Martinez Canillas, Thomas Zimmermann, Zeng Heng
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/vga16fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c
index 1a8ffdb2be26..34d00347ad58 100644
--- a/drivers/video/fbdev/vga16fb.c
+++ b/drivers/video/fbdev/vga16fb.c
@@ -1401,14 +1401,12 @@ static int vga16fb_probe(struct platform_device *dev)
 	return ret;
 }
 
-static int vga16fb_remove(struct platform_device *dev)
+static void vga16fb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
 
 	if (info)
 		unregister_framebuffer(info);
-
-	return 0;
 }
 
 static const struct platform_device_id vga16fb_driver_id_table[] = {
@@ -1420,7 +1418,7 @@ MODULE_DEVICE_TABLE(platform, vga16fb_driver_id_table);
 
 static struct platform_driver vga16fb_driver = {
 	.probe = vga16fb_probe,
-	.remove = vga16fb_remove,
+	.remove_new = vga16fb_remove,
 	.driver = {
 		.name = "vga16fb",
 	},
-- 
2.39.2


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

* [PATCH 47/51] video: fbdev: via: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (45 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 46/51] video: fbdev: vga16fb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 48/51] video: fbdev: vt8500lcdfb: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Florian Tobias Schandinat, Helge Deller; +Cc: linux-fbdev, dri-devel, 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/video/fbdev/via/via-gpio.c | 5 ++---
 drivers/video/fbdev/via/via_i2c.c  | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/via/via-gpio.c b/drivers/video/fbdev/via/via-gpio.c
index febb2aadd822..f1b670397c02 100644
--- a/drivers/video/fbdev/via/via-gpio.c
+++ b/drivers/video/fbdev/via/via-gpio.c
@@ -262,7 +262,7 @@ static int viafb_gpio_probe(struct platform_device *platdev)
 }
 
 
-static int viafb_gpio_remove(struct platform_device *platdev)
+static void viafb_gpio_remove(struct platform_device *platdev)
 {
 	unsigned long flags;
 	int i;
@@ -285,7 +285,6 @@ static int viafb_gpio_remove(struct platform_device *platdev)
 		viafb_gpio_disable(viafb_gpio_config.active_gpios[i]);
 	viafb_gpio_config.gpio_chip.ngpio = 0;
 	spin_unlock_irqrestore(&viafb_gpio_config.vdev->reg_lock, flags);
-	return 0;
 }
 
 static struct platform_driver via_gpio_driver = {
@@ -293,7 +292,7 @@ static struct platform_driver via_gpio_driver = {
 		.name = "viafb-gpio",
 	},
 	.probe = viafb_gpio_probe,
-	.remove = viafb_gpio_remove,
+	.remove_new = viafb_gpio_remove,
 };
 
 int viafb_gpio_init(void)
diff --git a/drivers/video/fbdev/via/via_i2c.c b/drivers/video/fbdev/via/via_i2c.c
index c7e63ab47c39..c35e530e0ec9 100644
--- a/drivers/video/fbdev/via/via_i2c.c
+++ b/drivers/video/fbdev/via/via_i2c.c
@@ -246,7 +246,7 @@ static int viafb_i2c_probe(struct platform_device *platdev)
 	return 0;
 }
 
-static int viafb_i2c_remove(struct platform_device *platdev)
+static void viafb_i2c_remove(struct platform_device *platdev)
 {
 	int i;
 
@@ -259,7 +259,6 @@ static int viafb_i2c_remove(struct platform_device *platdev)
 		if (i2c_stuff->is_active)
 			i2c_del_adapter(&i2c_stuff->adapter);
 	}
-	return 0;
 }
 
 static struct platform_driver via_i2c_driver = {
@@ -267,7 +266,7 @@ static struct platform_driver via_i2c_driver = {
 		.name = "viafb-i2c",
 	},
 	.probe = viafb_i2c_probe,
-	.remove = viafb_i2c_remove,
+	.remove_new = viafb_i2c_remove,
 };
 
 int viafb_i2c_init(void)
-- 
2.39.2


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

* [PATCH 48/51] video: fbdev: vt8500lcdfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (46 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 47/51] video: fbdev: via: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 49/51] video: fbdev: wm8505fb: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-arm-kernel, linux-fbdev, dri-devel, 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/video/fbdev/vt8500lcdfb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c
index c61476247ba8..31d4e85b220c 100644
--- a/drivers/video/fbdev/vt8500lcdfb.c
+++ b/drivers/video/fbdev/vt8500lcdfb.c
@@ -439,7 +439,7 @@ static int vt8500lcd_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int vt8500lcd_remove(struct platform_device *pdev)
+static void vt8500lcd_remove(struct platform_device *pdev)
 {
 	struct vt8500lcd_info *fbi = platform_get_drvdata(pdev);
 	struct resource *res;
@@ -462,8 +462,6 @@ static int vt8500lcd_remove(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	release_mem_region(res->start, resource_size(res));
-
-	return 0;
 }
 
 static const struct of_device_id via_dt_ids[] = {
@@ -473,7 +471,7 @@ static const struct of_device_id via_dt_ids[] = {
 
 static struct platform_driver vt8500lcd_driver = {
 	.probe		= vt8500lcd_probe,
-	.remove		= vt8500lcd_remove,
+	.remove_new	= vt8500lcd_remove,
 	.driver		= {
 		.name	= "vt8500-lcd",
 		.of_match_table = of_match_ptr(via_dt_ids),
-- 
2.39.2


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

* [PATCH 49/51] video: fbdev: wm8505fb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (47 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 48/51] video: fbdev: vt8500lcdfb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 50/51] video: fbdev: wmt_ge_rops: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-arm-kernel, linux-fbdev, dri-devel, 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/video/fbdev/wm8505fb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/wm8505fb.c b/drivers/video/fbdev/wm8505fb.c
index 8f4d674fa0d0..cf0ac6c2d4c7 100644
--- a/drivers/video/fbdev/wm8505fb.c
+++ b/drivers/video/fbdev/wm8505fb.c
@@ -374,7 +374,7 @@ static int wm8505fb_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int wm8505fb_remove(struct platform_device *pdev)
+static void wm8505fb_remove(struct platform_device *pdev)
 {
 	struct wm8505fb_info *fbi = platform_get_drvdata(pdev);
 
@@ -384,8 +384,6 @@ static int wm8505fb_remove(struct platform_device *pdev)
 
 	if (fbi->fb.cmap.len)
 		fb_dealloc_cmap(&fbi->fb.cmap);
-
-	return 0;
 }
 
 static const struct of_device_id wmt_dt_ids[] = {
@@ -395,7 +393,7 @@ static const struct of_device_id wmt_dt_ids[] = {
 
 static struct platform_driver wm8505fb_driver = {
 	.probe		= wm8505fb_probe,
-	.remove		= wm8505fb_remove,
+	.remove_new	= wm8505fb_remove,
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.of_match_table = wmt_dt_ids,
-- 
2.39.2


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

* [PATCH 50/51] video: fbdev: wmt_ge_rops: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (48 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 49/51] video: fbdev: wm8505fb: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-18 23:54 ` [PATCH 51/51] video: fbdev: xilinxfb: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-arm-kernel, linux-fbdev, dri-devel, 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/video/fbdev/wmt_ge_rops.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/wmt_ge_rops.c b/drivers/video/fbdev/wmt_ge_rops.c
index 42255d27a1db..6196b9a6c44d 100644
--- a/drivers/video/fbdev/wmt_ge_rops.c
+++ b/drivers/video/fbdev/wmt_ge_rops.c
@@ -145,10 +145,9 @@ static int wmt_ge_rops_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int wmt_ge_rops_remove(struct platform_device *pdev)
+static void wmt_ge_rops_remove(struct platform_device *pdev)
 {
 	iounmap(regbase);
-	return 0;
 }
 
 static const struct of_device_id wmt_dt_ids[] = {
@@ -158,7 +157,7 @@ static const struct of_device_id wmt_dt_ids[] = {
 
 static struct platform_driver wmt_ge_rops_driver = {
 	.probe		= wmt_ge_rops_probe,
-	.remove		= wmt_ge_rops_remove,
+	.remove_new	= wmt_ge_rops_remove,
 	.driver		= {
 		.name	= "wmt_ge_rops",
 		.of_match_table = wmt_dt_ids,
-- 
2.39.2


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

* [PATCH 51/51] video: fbdev: xilinxfb: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (49 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 50/51] video: fbdev: wmt_ge_rops: " Uwe Kleine-König
@ 2023-03-18 23:54 ` Uwe Kleine-König
  2023-03-19 18:04 ` [PATCH 00/51] video: fbdev: " Helge Deller
  2023-03-20 10:03 ` Thomas Zimmermann
  52 siblings, 0 replies; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-18 23:54 UTC (permalink / raw)
  To: Helge Deller, Michal Simek
  Cc: linux-fbdev, dri-devel, 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/video/fbdev/xilinxfb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/xilinxfb.c b/drivers/video/fbdev/xilinxfb.c
index 1ac83900a21c..90c2939971a2 100644
--- a/drivers/video/fbdev/xilinxfb.c
+++ b/drivers/video/fbdev/xilinxfb.c
@@ -476,11 +476,9 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
 	return xilinxfb_assign(pdev, drvdata, &pdata);
 }
 
-static int xilinxfb_of_remove(struct platform_device *op)
+static void xilinxfb_of_remove(struct platform_device *op)
 {
 	xilinxfb_release(&op->dev);
-
-	return 0;
 }
 
 /* Match table for of_platform binding */
@@ -496,7 +494,7 @@ MODULE_DEVICE_TABLE(of, xilinxfb_of_match);
 
 static struct platform_driver xilinxfb_of_driver = {
 	.probe = xilinxfb_of_probe,
-	.remove = xilinxfb_of_remove,
+	.remove_new = xilinxfb_of_remove,
 	.driver = {
 		.name = DRIVER_NAME,
 		.of_match_table = xilinxfb_of_match,
-- 
2.39.2


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

* Re: [PATCH 39/51] video: fbdev: sh_mobile_lcdcfb: Convert to platform remove callback returning void
  2023-03-18 23:54 ` [PATCH 39/51] video: fbdev: sh_mobile_lcdcfb: " Uwe Kleine-König
@ 2023-03-19  9:16   ` Geert Uytterhoeven
  0 siblings, 0 replies; 61+ messages in thread
From: Geert Uytterhoeven @ 2023-03-19  9:16 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Helge Deller, Thomas Zimmermann, Javier Martinez Canillas,
	ye xingchen, linux-fbdev, dri-devel, kernel

On Sun, Mar 19, 2023 at 12:54 AM 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: 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] 61+ messages in thread

* Re: [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (50 preceding siblings ...)
  2023-03-18 23:54 ` [PATCH 51/51] video: fbdev: xilinxfb: " Uwe Kleine-König
@ 2023-03-19 18:04 ` Helge Deller
  2023-03-19 21:08   ` Uwe Kleine-König
  2023-05-30 14:02   ` Uwe Kleine-König
  2023-03-20 10:03 ` Thomas Zimmermann
  52 siblings, 2 replies; 61+ messages in thread
From: Helge Deller @ 2023-03-19 18:04 UTC (permalink / raw)
  To: Uwe Kleine-König, Yihao Han, Javier Martinez Canillas,
	Thomas Zimmermann, Wolfram Sang, Alexander Shiyan, Dongliang Mu,
	Peter Jones, Gaosheng Cui, Timur Tabi, Xuezhi Zhang,
	Jiasheng Jiang, Ferenc Bakonyi, Sascha Hauer, Shawn Guo,
	Christophe Leroy, Stephen Kitt, Daniel Thompson, Mark Brown,
	Rob Herring, Bartlomiej Zolnierkiewicz, Arnd Bergmann,
	Tony Lindgren, Jiapeng Chong, Yu Zhe, Xu Panda, Zhang Qilong,
	Hyunwoo Kim, Yang Yingliang, Robert Jarzmik, Ulf Hansson,
	Wang Qing, Kristoffer Ericson, Jingoo Han, ye xingchen,
	Geert Uytterhoeven, Hans de Goede, Michal Januszewski,
	Daniel Vetter, Zeng Heng, Florian Tobias Schandinat,
	Michal Simek
  Cc: linux-fbdev, dri-devel, kernel, linux-arm-kernel, linux-nvidia,
	Fabio Estevam, NXP Linux Team, linux-omap

Hello Uwe,

On 3/19/23 00:53, Uwe Kleine-König wrote:
> this series adapts the platform drivers below drivers/video/fbdev 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.
>
> The first patch simplifies the remove callback of one driver to obviously
> always return zero. After that all drivers are converted trivially to
> .remove_new().

Thanks for that patch series. It's a nice cleanup.
I've applied it to the fbdev "for-next" git tree for now to get some compile testing.
I hope that's ok for you.

Regarding the new "remove_new" struct member I'd prefer a better name but don't
have any idea yet...

Helge

>
> Best regards
> Uwe
>
> Uwe Kleine-König (51):
>    video: fbdev: au1100fb: Drop if with an always false condition
>    video: fbdev: arcfb: Convert to platform remove callback returning
>      void
>    video: fbdev: au1100fb: Convert to platform remove callback returning
>      void
>    video: fbdev: au1200fb: Convert to platform remove callback returning
>      void
>    video: fbdev: broadsheetfb: Convert to platform remove callback
>      returning void
>    video: fbdev: bw2: Convert to platform remove callback returning void
>    video: fbdev: cg14: Convert to platform remove callback returning void
>    video: fbdev: cg3: Convert to platform remove callback returning void
>    video: fbdev: cg6: Convert to platform remove callback returning void
>    video: fbdev: clps711x-fb: Convert to platform remove callback
>      returning void
>    video: fbdev: cobalt_lcdfb: Convert to platform remove callback
>      returning void
>    video: fbdev: da8xx-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: efifb: Convert to platform remove callback returning
>      void
>    video: fbdev: ep93xx-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: ffb: Convert to platform remove callback returning void
>    video: fbdev: fsl-diu-fb: Convert to platform remove callback
>      returning void
>    video: fbdev: gbefb: Convert to platform remove callback returning
>      void
>    video: fbdev: goldfishfb: Convert to platform remove callback
>      returning void
>    video: fbdev: grvga: Convert to platform remove callback returning
>      void
>    video: fbdev: hecubafb: Convert to platform remove callback returning
>      void
>    video: fbdev: hgafb: Convert to platform remove callback returning
>      void
>    video: fbdev: hitfb: Convert to platform remove callback returning
>      void
>    video: fbdev: imxfb: Convert to platform remove callback returning
>      void
>    video: fbdev: leo: Convert to platform remove callback returning void
>    video: fbdev: mb862xx: Convert to platform remove callback returning
>      void
>    video: fbdev: metronomefb: Convert to platform remove callback
>      returning void
>    video: fbdev: mx3fb: Convert to platform remove callback returning
>      void
>    video: fbdev: ocfb: Convert to platform remove callback returning void
>    video: fbdev: offb: Convert to platform remove callback returning void
>    video: fbdev: omapfb: Convert to platform remove callback returning
>      void
>    video: fbdev: p9100: Convert to platform remove callback returning
>      void
>    video: fbdev: platinumfb: Convert to platform remove callback
>      returning void
>    video: fbdev: pxa168fb: Convert to platform remove callback returning
>      void
>    video: fbdev: pxa3xx-gcu: Convert to platform remove callback
>      returning void
>    video: fbdev: pxafb: Convert to platform remove callback returning
>      void
>    video: fbdev: s1d13xxxfb: Convert to platform remove callback
>      returning void
>    video: fbdev: s3c-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: sh7760fb: Convert to platform remove callback returning
>      void
>    video: fbdev: sh_mobile_lcdcfb: Convert to platform remove callback
>      returning void
>    video: fbdev: simplefb: Convert to platform remove callback returning
>      void
>    video: fbdev: sm501fb: Convert to platform remove callback returning
>      void
>    video: fbdev: tcx: Convert to platform remove callback returning void
>    video: fbdev: uvesafb: Convert to platform remove callback returning
>      void
>    video: fbdev: vesafb: Convert to platform remove callback returning
>      void
>    video: fbdev: vfb: Convert to platform remove callback returning void
>    video: fbdev: vga16fb: Convert to platform remove callback returning
>      void
>    video: fbdev: via: Convert to platform remove callback returning void
>    video: fbdev: vt8500lcdfb: Convert to platform remove callback
>      returning void
>    video: fbdev: wm8505fb: Convert to platform remove callback returning
>      void
>    video: fbdev: wmt_ge_rops: Convert to platform remove callback
>      returning void
>    video: fbdev: xilinxfb: Convert to platform remove callback returning
>      void
>
>   drivers/video/fbdev/arcfb.c                    |  5 ++---
>   drivers/video/fbdev/au1100fb.c                 | 11 +++--------
>   drivers/video/fbdev/au1200fb.c                 |  6 ++----
>   drivers/video/fbdev/broadsheetfb.c             |  5 ++---
>   drivers/video/fbdev/bw2.c                      |  6 ++----
>   drivers/video/fbdev/cg14.c                     |  6 ++----
>   drivers/video/fbdev/cg3.c                      |  6 ++----
>   drivers/video/fbdev/cg6.c                      |  6 ++----
>   drivers/video/fbdev/clps711x-fb.c              |  6 ++----
>   drivers/video/fbdev/cobalt_lcdfb.c             |  6 ++----
>   drivers/video/fbdev/da8xx-fb.c                 |  6 ++----
>   drivers/video/fbdev/efifb.c                    |  6 ++----
>   drivers/video/fbdev/ep93xx-fb.c                |  6 ++----
>   drivers/video/fbdev/ffb.c                      |  6 ++----
>   drivers/video/fbdev/fsl-diu-fb.c               |  6 ++----
>   drivers/video/fbdev/gbefb.c                    |  6 ++----
>   drivers/video/fbdev/goldfishfb.c               |  5 ++---
>   drivers/video/fbdev/grvga.c                    |  6 ++----
>   drivers/video/fbdev/hecubafb.c                 |  5 ++---
>   drivers/video/fbdev/hgafb.c                    |  6 ++----
>   drivers/video/fbdev/hitfb.c                    |  6 ++----
>   drivers/video/fbdev/imxfb.c                    |  6 ++----
>   drivers/video/fbdev/leo.c                      |  6 ++----
>   drivers/video/fbdev/mb862xx/mb862xxfbdrv.c     |  5 ++---
>   drivers/video/fbdev/metronomefb.c              |  5 ++---
>   drivers/video/fbdev/mx3fb.c                    |  5 ++---
>   drivers/video/fbdev/ocfb.c                     |  6 ++----
>   drivers/video/fbdev/offb.c                     |  8 +++-----
>   drivers/video/fbdev/omap/omapfb_main.c         |  6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/core.c    |  6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/dispc.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dpi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dsi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dss.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/sdi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/venc.c    |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/omapfb-main.c |  6 ++----
>   drivers/video/fbdev/p9100.c                    |  6 ++----
>   drivers/video/fbdev/platinumfb.c               |  6 ++----
>   drivers/video/fbdev/pxa168fb.c                 |  8 +++-----
>   drivers/video/fbdev/pxa3xx-gcu.c               |  6 ++----
>   drivers/video/fbdev/pxafb.c                    |  8 +++-----
>   drivers/video/fbdev/s1d13xxxfb.c               |  5 ++---
>   drivers/video/fbdev/s3c-fb.c                   |  6 ++----
>   drivers/video/fbdev/sh7760fb.c                 |  6 ++----
>   drivers/video/fbdev/sh_mobile_lcdcfb.c         |  5 ++---
>   drivers/video/fbdev/simplefb.c                 |  6 ++----
>   drivers/video/fbdev/sm501fb.c                  |  6 ++----
>   drivers/video/fbdev/tcx.c                      |  6 ++----
>   drivers/video/fbdev/uvesafb.c                  |  6 ++----
>   drivers/video/fbdev/vesafb.c                   |  6 ++----
>   drivers/video/fbdev/vfb.c                      |  5 ++---
>   drivers/video/fbdev/vga16fb.c                  |  6 ++----
>   drivers/video/fbdev/via/via-gpio.c             |  5 ++---
>   drivers/video/fbdev/via/via_i2c.c              |  5 ++---
>   drivers/video/fbdev/vt8500lcdfb.c              |  6 ++----
>   drivers/video/fbdev/wm8505fb.c                 |  6 ++----
>   drivers/video/fbdev/wmt_ge_rops.c              |  5 ++---
>   drivers/video/fbdev/xilinxfb.c                 |  6 ++----
>   61 files changed, 126 insertions(+), 230 deletions(-)
>
> base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6


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

* Re: [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void
  2023-03-19 18:04 ` [PATCH 00/51] video: fbdev: " Helge Deller
@ 2023-03-19 21:08   ` Uwe Kleine-König
  2023-03-19 21:41     ` Helge Deller
  2023-05-30 14:02   ` Uwe Kleine-König
  1 sibling, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-03-19 21:08 UTC (permalink / raw)
  To: Helge Deller
  Cc: Yihao Han, Javier Martinez Canillas, Thomas Zimmermann,
	Wolfram Sang, Alexander Shiyan, Dongliang Mu, Peter Jones,
	Gaosheng Cui, Timur Tabi, Xuezhi Zhang, Jiasheng Jiang,
	Ferenc Bakonyi, Sascha Hauer, Shawn Guo, Christophe Leroy,
	Stephen Kitt, Daniel Thompson, Mark Brown, Rob Herring,
	Arnd Bergmann, Tony Lindgren, Jiapeng Chong, Yu Zhe, Xu Panda,
	Zhang Qilong, Hyunwoo Kim, Yang Yingliang, Robert Jarzmik,
	Ulf Hansson, Wang Qing, Kristoffer Ericson, Jingoo Han,
	ye xingchen, Geert Uytterhoeven, Hans de Goede, Daniel Vetter,
	Zeng Heng, Florian Tobias Schandinat, Michal Simek, linux-fbdev,
	dri-devel, NXP Linux Team, kernel, linux-nvidia, linux-omap,
	Fabio Estevam, linux-arm-kernel

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

Hello,

[Dropped Bartlomiej Zolnierkiewicz and Michal Januszewski from Cc, their
email addresses bounced]

On Sun, Mar 19, 2023 at 07:04:54PM +0100, Helge Deller wrote:
> Hello Uwe,
> 
> On 3/19/23 00:53, Uwe Kleine-König wrote:
> > this series adapts the platform drivers below drivers/video/fbdev 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.
> > 
> > The first patch simplifies the remove callback of one driver to obviously
> > always return zero. After that all drivers are converted trivially to
> > .remove_new().
> 
> Thanks for that patch series. It's a nice cleanup.
> I've applied it to the fbdev "for-next" git tree for now to get some compile testing.
> I hope that's ok for you.
> 
> Regarding the new "remove_new" struct member I'd prefer a better name but don't
> have any idea yet...

Ideally we won't have to life with it for long. The eventual plan is to
switch back to "remove" once all drivers are converted. So I didn't
think intensively about a better name. Did you know that struct
i2c_driver has a "temporary" .probe_new() callback since 2016?

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

* Re: [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void
  2023-03-19 21:08   ` Uwe Kleine-König
@ 2023-03-19 21:41     ` Helge Deller
  0 siblings, 0 replies; 61+ messages in thread
From: Helge Deller @ 2023-03-19 21:41 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Yihao Han, Javier Martinez Canillas, Thomas Zimmermann,
	Wolfram Sang, Alexander Shiyan, Dongliang Mu, Peter Jones,
	Gaosheng Cui, Timur Tabi, Xuezhi Zhang, Jiasheng Jiang,
	Ferenc Bakonyi, Sascha Hauer, Shawn Guo, Christophe Leroy,
	Stephen Kitt, Daniel Thompson, Mark Brown, Rob Herring,
	Arnd Bergmann, Tony Lindgren, Jiapeng Chong, Yu Zhe, Xu Panda,
	Zhang Qilong, Hyunwoo Kim, Yang Yingliang, Robert Jarzmik,
	Ulf Hansson, Wang Qing, Kristoffer Ericson, Jingoo Han,
	ye xingchen, Geert Uytterhoeven, Hans de Goede, Daniel Vetter,
	Zeng Heng, Florian Tobias Schandinat, Michal Simek, linux-fbdev,
	dri-devel, NXP Linux Team, kernel, linux-nvidia, linux-omap,
	Fabio Estevam, linux-arm-kernel

On 3/19/23 22:08, Uwe Kleine-König wrote:
> Hello,
>
> [Dropped Bartlomiej Zolnierkiewicz and Michal Januszewski from Cc, their
> email addresses bounced]
>
> On Sun, Mar 19, 2023 at 07:04:54PM +0100, Helge Deller wrote:
>> Hello Uwe,
>>
>> On 3/19/23 00:53, Uwe Kleine-König wrote:
>>> this series adapts the platform drivers below drivers/video/fbdev 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.
>>>
>>> The first patch simplifies the remove callback of one driver to obviously
>>> always return zero. After that all drivers are converted trivially to
>>> .remove_new().
>>
>> Thanks for that patch series. It's a nice cleanup.
>> I've applied it to the fbdev "for-next" git tree for now to get some compile testing.
>> I hope that's ok for you.
>>
>> Regarding the new "remove_new" struct member I'd prefer a better name but don't
>> have any idea yet...
>
> Ideally we won't have to life with it for long. The eventual plan is to
> switch back to "remove" once all drivers are converted. So I didn't
> think intensively about a better name.

Ok.

> Did you know that struct i2c_driver has a "temporary" .probe_new()
> callback since 2016?
No, I didn't knew.  Nice :-)

Helge

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

* Re: [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void
  2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (51 preceding siblings ...)
  2023-03-19 18:04 ` [PATCH 00/51] video: fbdev: " Helge Deller
@ 2023-03-20 10:03 ` Thomas Zimmermann
  52 siblings, 0 replies; 61+ messages in thread
From: Thomas Zimmermann @ 2023-03-20 10:03 UTC (permalink / raw)
  To: Uwe Kleine-König, Helge Deller, Yihao Han, Jaya Kumar,
	Javier Martinez Canillas, Wolfram Sang, Alexander Shiyan,
	Dongliang Mu, Peter Jones, Gaosheng Cui, Timur Tabi,
	Xuezhi Zhang, Jiasheng Jiang, Ferenc Bakonyi, Sascha Hauer,
	Shawn Guo, Christophe Leroy, Stephen Kitt, Daniel Thompson,
	Mark Brown, Rob Herring, Bartlomiej Zolnierkiewicz,
	Arnd Bergmann, Tony Lindgren, Jiapeng Chong, Yu Zhe, Xu Panda,
	Zhang Qilong, Hyunwoo Kim, Yang Yingliang, Robert Jarzmik,
	Ulf Hansson, wangkailong, Wang Qing, Kristoffer Ericson,
	Jingoo Han, ye xingchen, Geert Uytterhoeven, Hans de Goede,
	Michal Januszewski, Daniel Vetter, Zeng Heng,
	Florian Tobias Schandinat, Michal Simek
  Cc: linux-fbdev, dri-devel, NXP Linux Team, kernel, linux-nvidia,
	linux-omap, linux-arm-kernel


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

I'm a bit late, but still

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

for the series. Thanks for this cleanup.

Best regards
Thomas

Am 19.03.23 um 00:53 schrieb Uwe Kleine-König:
> Hello,
> 
> this series adapts the platform drivers below drivers/video/fbdev 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.
> 
> The first patch simplifies the remove callback of one driver to obviously
> always return zero. After that all drivers are converted trivially to
> .remove_new().
> 
> Best regards
> Uwe
> 
> Uwe Kleine-König (51):
>    video: fbdev: au1100fb: Drop if with an always false condition
>    video: fbdev: arcfb: Convert to platform remove callback returning
>      void
>    video: fbdev: au1100fb: Convert to platform remove callback returning
>      void
>    video: fbdev: au1200fb: Convert to platform remove callback returning
>      void
>    video: fbdev: broadsheetfb: Convert to platform remove callback
>      returning void
>    video: fbdev: bw2: Convert to platform remove callback returning void
>    video: fbdev: cg14: Convert to platform remove callback returning void
>    video: fbdev: cg3: Convert to platform remove callback returning void
>    video: fbdev: cg6: Convert to platform remove callback returning void
>    video: fbdev: clps711x-fb: Convert to platform remove callback
>      returning void
>    video: fbdev: cobalt_lcdfb: Convert to platform remove callback
>      returning void
>    video: fbdev: da8xx-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: efifb: Convert to platform remove callback returning
>      void
>    video: fbdev: ep93xx-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: ffb: Convert to platform remove callback returning void
>    video: fbdev: fsl-diu-fb: Convert to platform remove callback
>      returning void
>    video: fbdev: gbefb: Convert to platform remove callback returning
>      void
>    video: fbdev: goldfishfb: Convert to platform remove callback
>      returning void
>    video: fbdev: grvga: Convert to platform remove callback returning
>      void
>    video: fbdev: hecubafb: Convert to platform remove callback returning
>      void
>    video: fbdev: hgafb: Convert to platform remove callback returning
>      void
>    video: fbdev: hitfb: Convert to platform remove callback returning
>      void
>    video: fbdev: imxfb: Convert to platform remove callback returning
>      void
>    video: fbdev: leo: Convert to platform remove callback returning void
>    video: fbdev: mb862xx: Convert to platform remove callback returning
>      void
>    video: fbdev: metronomefb: Convert to platform remove callback
>      returning void
>    video: fbdev: mx3fb: Convert to platform remove callback returning
>      void
>    video: fbdev: ocfb: Convert to platform remove callback returning void
>    video: fbdev: offb: Convert to platform remove callback returning void
>    video: fbdev: omapfb: Convert to platform remove callback returning
>      void
>    video: fbdev: p9100: Convert to platform remove callback returning
>      void
>    video: fbdev: platinumfb: Convert to platform remove callback
>      returning void
>    video: fbdev: pxa168fb: Convert to platform remove callback returning
>      void
>    video: fbdev: pxa3xx-gcu: Convert to platform remove callback
>      returning void
>    video: fbdev: pxafb: Convert to platform remove callback returning
>      void
>    video: fbdev: s1d13xxxfb: Convert to platform remove callback
>      returning void
>    video: fbdev: s3c-fb: Convert to platform remove callback returning
>      void
>    video: fbdev: sh7760fb: Convert to platform remove callback returning
>      void
>    video: fbdev: sh_mobile_lcdcfb: Convert to platform remove callback
>      returning void
>    video: fbdev: simplefb: Convert to platform remove callback returning
>      void
>    video: fbdev: sm501fb: Convert to platform remove callback returning
>      void
>    video: fbdev: tcx: Convert to platform remove callback returning void
>    video: fbdev: uvesafb: Convert to platform remove callback returning
>      void
>    video: fbdev: vesafb: Convert to platform remove callback returning
>      void
>    video: fbdev: vfb: Convert to platform remove callback returning void
>    video: fbdev: vga16fb: Convert to platform remove callback returning
>      void
>    video: fbdev: via: Convert to platform remove callback returning void
>    video: fbdev: vt8500lcdfb: Convert to platform remove callback
>      returning void
>    video: fbdev: wm8505fb: Convert to platform remove callback returning
>      void
>    video: fbdev: wmt_ge_rops: Convert to platform remove callback
>      returning void
>    video: fbdev: xilinxfb: Convert to platform remove callback returning
>      void
> 
>   drivers/video/fbdev/arcfb.c                    |  5 ++---
>   drivers/video/fbdev/au1100fb.c                 | 11 +++--------
>   drivers/video/fbdev/au1200fb.c                 |  6 ++----
>   drivers/video/fbdev/broadsheetfb.c             |  5 ++---
>   drivers/video/fbdev/bw2.c                      |  6 ++----
>   drivers/video/fbdev/cg14.c                     |  6 ++----
>   drivers/video/fbdev/cg3.c                      |  6 ++----
>   drivers/video/fbdev/cg6.c                      |  6 ++----
>   drivers/video/fbdev/clps711x-fb.c              |  6 ++----
>   drivers/video/fbdev/cobalt_lcdfb.c             |  6 ++----
>   drivers/video/fbdev/da8xx-fb.c                 |  6 ++----
>   drivers/video/fbdev/efifb.c                    |  6 ++----
>   drivers/video/fbdev/ep93xx-fb.c                |  6 ++----
>   drivers/video/fbdev/ffb.c                      |  6 ++----
>   drivers/video/fbdev/fsl-diu-fb.c               |  6 ++----
>   drivers/video/fbdev/gbefb.c                    |  6 ++----
>   drivers/video/fbdev/goldfishfb.c               |  5 ++---
>   drivers/video/fbdev/grvga.c                    |  6 ++----
>   drivers/video/fbdev/hecubafb.c                 |  5 ++---
>   drivers/video/fbdev/hgafb.c                    |  6 ++----
>   drivers/video/fbdev/hitfb.c                    |  6 ++----
>   drivers/video/fbdev/imxfb.c                    |  6 ++----
>   drivers/video/fbdev/leo.c                      |  6 ++----
>   drivers/video/fbdev/mb862xx/mb862xxfbdrv.c     |  5 ++---
>   drivers/video/fbdev/metronomefb.c              |  5 ++---
>   drivers/video/fbdev/mx3fb.c                    |  5 ++---
>   drivers/video/fbdev/ocfb.c                     |  6 ++----
>   drivers/video/fbdev/offb.c                     |  8 +++-----
>   drivers/video/fbdev/omap/omapfb_main.c         |  6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/core.c    |  6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/dispc.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dpi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dsi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/dss.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c   |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/sdi.c     |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/dss/venc.c    |  5 ++---
>   drivers/video/fbdev/omap2/omapfb/omapfb-main.c |  6 ++----
>   drivers/video/fbdev/p9100.c                    |  6 ++----
>   drivers/video/fbdev/platinumfb.c               |  6 ++----
>   drivers/video/fbdev/pxa168fb.c                 |  8 +++-----
>   drivers/video/fbdev/pxa3xx-gcu.c               |  6 ++----
>   drivers/video/fbdev/pxafb.c                    |  8 +++-----
>   drivers/video/fbdev/s1d13xxxfb.c               |  5 ++---
>   drivers/video/fbdev/s3c-fb.c                   |  6 ++----
>   drivers/video/fbdev/sh7760fb.c                 |  6 ++----
>   drivers/video/fbdev/sh_mobile_lcdcfb.c         |  5 ++---
>   drivers/video/fbdev/simplefb.c                 |  6 ++----
>   drivers/video/fbdev/sm501fb.c                  |  6 ++----
>   drivers/video/fbdev/tcx.c                      |  6 ++----
>   drivers/video/fbdev/uvesafb.c                  |  6 ++----
>   drivers/video/fbdev/vesafb.c                   |  6 ++----
>   drivers/video/fbdev/vfb.c                      |  5 ++---
>   drivers/video/fbdev/vga16fb.c                  |  6 ++----
>   drivers/video/fbdev/via/via-gpio.c             |  5 ++---
>   drivers/video/fbdev/via/via_i2c.c              |  5 ++---
>   drivers/video/fbdev/vt8500lcdfb.c              |  6 ++----
>   drivers/video/fbdev/wm8505fb.c                 |  6 ++----
>   drivers/video/fbdev/wmt_ge_rops.c              |  5 ++---
>   drivers/video/fbdev/xilinxfb.c                 |  6 ++----
>   61 files changed, 126 insertions(+), 230 deletions(-)
> 
> base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void
  2023-03-19 18:04 ` [PATCH 00/51] video: fbdev: " Helge Deller
  2023-03-19 21:08   ` Uwe Kleine-König
@ 2023-05-30 14:02   ` Uwe Kleine-König
  2023-05-30 16:12     ` Helge Deller
  1 sibling, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-05-30 14:02 UTC (permalink / raw)
  To: Helge Deller
  Cc: Yihao Han, Javier Martinez Canillas, Thomas Zimmermann,
	Wolfram Sang, Alexander Shiyan, Dongliang Mu, Peter Jones,
	Gaosheng Cui, Timur Tabi, Xuezhi Zhang, Jiasheng Jiang,
	Sascha Hauer, Shawn Guo, Christophe Leroy, Stephen Kitt,
	Daniel Thompson, Mark Brown, Rob Herring, Arnd Bergmann,
	Tony Lindgren, Jiapeng Chong, Yu Zhe, Xu Panda, Zhang Qilong,
	Hyunwoo Kim, Yang Yingliang, Robert Jarzmik, Ulf Hansson,
	Wang Qing, Kristoffer Ericson, Jingoo Han, ye xingchen,
	Geert Uytterhoeven, Hans de Goede, Daniel Vetter, Zeng Heng,
	Florian Tobias Schandinat, Michal Simek, linux-fbdev, dri-devel,
	NXP Linux Team, kernel, linux-omap, Fabio Estevam,
	linux-arm-kernel

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

[Dropped a few recipents that resulted in bounces before]

Hello,

On Sun, Mar 19, 2023 at 07:04:54PM +0100, Helge Deller wrote:
> On 3/19/23 00:53, Uwe Kleine-König wrote:
> > this series adapts the platform drivers below drivers/video/fbdev 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.
> > 
> > The first patch simplifies the remove callback of one driver to obviously
> > always return zero. After that all drivers are converted trivially to
> > .remove_new().
> 
> Thanks for that patch series. It's a nice cleanup.
> I've applied it to the fbdev "for-next" git tree for now to get some compile testing.
> I hope that's ok for you.

I found patches #7 up to #51 in next, but the first 6 patches are
missing. I guess this wasn't' done on purpose?

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

* Re: [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void
  2023-05-30 14:02   ` Uwe Kleine-König
@ 2023-05-30 16:12     ` Helge Deller
  2023-05-30 16:27       ` Uwe Kleine-König
  0 siblings, 1 reply; 61+ messages in thread
From: Helge Deller @ 2023-05-30 16:12 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Yihao Han, Javier Martinez Canillas, Thomas Zimmermann,
	Wolfram Sang, Alexander Shiyan, Dongliang Mu, Peter Jones,
	Gaosheng Cui, Timur Tabi, Xuezhi Zhang, Jiasheng Jiang,
	Sascha Hauer, Shawn Guo, Christophe Leroy, Stephen Kitt,
	Daniel Thompson, Mark Brown, Rob Herring, Arnd Bergmann,
	Tony Lindgren, Jiapeng Chong, Yu Zhe, Xu Panda, Zhang Qilong,
	Hyunwoo Kim, Yang Yingliang, Robert Jarzmik, Ulf Hansson,
	Wang Qing, Kristoffer Ericson, Jingoo Han, ye xingchen,
	Geert Uytterhoeven, Hans de Goede, Daniel Vetter, Zeng Heng,
	Florian Tobias Schandinat, Michal Simek, linux-fbdev, dri-devel,
	NXP Linux Team, kernel, linux-omap, Fabio Estevam,
	linux-arm-kernel

Hi Uwe,

On 5/30/23 16:02, Uwe Kleine-König wrote:
> On Sun, Mar 19, 2023 at 07:04:54PM +0100, Helge Deller wrote:
>> On 3/19/23 00:53, Uwe Kleine-König wrote:
>>> this series adapts the platform drivers below drivers/video/fbdev 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.
>>>
>>> The first patch simplifies the remove callback of one driver to obviously
>>> always return zero. After that all drivers are converted trivially to
>>> .remove_new().
>>
>> Thanks for that patch series. It's a nice cleanup.
>> I've applied it to the fbdev "for-next" git tree for now to get some compile testing.
>> I hope that's ok for you.
>
> I found patches #7 up to #51 in next, but the first 6 patches are
> missing. I guess this wasn't' done on purpose?

Strange. I don't know why I didn't applied those.

Anyway, I've just added them now:

Applying: video: fbdev: au1100fb: Drop if with an always false condition
Applying: video: fbdev: arcfb: Convert to platform remove callback returning void
Applying: video: fbdev: au1100fb: Convert to platform remove callback returning void
Applying: video: fbdev: au1200fb: Convert to platform remove callback returning void
Applying: video: fbdev: broadsheetfb: Convert to platform remove callback returning void
Applying: video: fbdev: bw2: Convert to platform remove callback returning void

Thanks!
Helge

Btw... I cleaned up some minor whitespace issues in patch 3 (au1100fb).

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

* Re: [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void
  2023-05-30 16:12     ` Helge Deller
@ 2023-05-30 16:27       ` Uwe Kleine-König
  2023-05-30 16:34         ` Helge Deller
  0 siblings, 1 reply; 61+ messages in thread
From: Uwe Kleine-König @ 2023-05-30 16:27 UTC (permalink / raw)
  To: Helge Deller
  Cc: Ulf Hansson, Stephen Kitt, Geert Uytterhoeven, Tony Lindgren,
	Daniel Vetter, linux-fbdev, dri-devel, Michal Simek, Wang Qing,
	Wolfram Sang, Peter Jones, Xuezhi Zhang, Robert Jarzmik,
	Gaosheng Cui, Rob Herring, Daniel Thompson, Alexander Shiyan,
	Florian Tobias Schandinat, Xu Panda, Javier Martinez Canillas,
	Christophe Leroy, Kristoffer Ericson, NXP Linux Team,
	Yang Yingliang, kernel, Arnd Bergmann, Jiapeng Chong, Yu Zhe,
	ye xingchen, Sascha Hauer, Jiasheng Jiang, Zeng Heng,
	Hans de Goede, Mark Brown, Fabio Estevam, Hyunwoo Kim,
	linux-omap, linux-arm-kernel, Yihao Han, Timur Tabi, Jingoo Han,
	Zhang Qilong, Dongliang Mu, Thomas Zimmermann, Shawn Guo

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

Hello Helge,

On Tue, May 30, 2023 at 06:12:09PM +0200, Helge Deller wrote:
> Btw... I cleaned up some minor whitespace issues in patch 3 (au1100fb).

We both did some different cleanup, on top of your
87be5a5d9a5c5b00505181eedbee62134f07d11d we could further cleanup doing

diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
index fb38557a9b63..648d6cac86e8 100644
--- a/drivers/video/fbdev/au1100fb.c
+++ b/drivers/video/fbdev/au1100fb.c
@@ -590,7 +590,7 @@ static struct platform_driver au1100fb_driver = {
 	.probe		= au1100fb_drv_probe,
 	.remove_new	= au1100fb_drv_remove,
 	.suspend	= au1100fb_drv_suspend,
-        .resume		= au1100fb_drv_resume,
+	.resume		= au1100fb_drv_resume,
 };
 module_platform_driver(au1100fb_driver);
 
Feel free to squash this into 87be5a5d9a5c5b00505181eedbee62134f07d11d.
If you want to apply it separately, either tell me to post a proper
patch, or apply it under your name with my Suggested-by -- whatever
suits you best.

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

* Re: [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void
  2023-05-30 16:27       ` Uwe Kleine-König
@ 2023-05-30 16:34         ` Helge Deller
  0 siblings, 0 replies; 61+ messages in thread
From: Helge Deller @ 2023-05-30 16:34 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Ulf Hansson, Stephen Kitt, Geert Uytterhoeven, Tony Lindgren,
	Daniel Vetter, linux-fbdev, dri-devel, Michal Simek, Wang Qing,
	Wolfram Sang, Peter Jones, Xuezhi Zhang, Robert Jarzmik,
	Gaosheng Cui, Rob Herring, Daniel Thompson, Alexander Shiyan,
	Florian Tobias Schandinat, Xu Panda, Javier Martinez Canillas,
	Christophe Leroy, Kristoffer Ericson, NXP Linux Team,
	Yang Yingliang, kernel, Arnd Bergmann, Jiapeng Chong, Yu Zhe,
	ye xingchen, Sascha Hauer, Jiasheng Jiang, Zeng Heng,
	Hans de Goede, Mark Brown, Fabio Estevam, Hyunwoo Kim,
	linux-omap, linux-arm-kernel, Yihao Han, Timur Tabi, Jingoo Han,
	Zhang Qilong, Dongliang Mu, Thomas Zimmermann, Shawn Guo

On 5/30/23 18:27, Uwe Kleine-König wrote:
> Hello Helge,
>
> On Tue, May 30, 2023 at 06:12:09PM +0200, Helge Deller wrote:
>> Btw... I cleaned up some minor whitespace issues in patch 3 (au1100fb).
>
> We both did some different cleanup, on top of your
> 87be5a5d9a5c5b00505181eedbee62134f07d11d we could further cleanup doing
>
> diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c
> index fb38557a9b63..648d6cac86e8 100644
> --- a/drivers/video/fbdev/au1100fb.c
> +++ b/drivers/video/fbdev/au1100fb.c
> @@ -590,7 +590,7 @@ static struct platform_driver au1100fb_driver = {
>   	.probe		= au1100fb_drv_probe,
>   	.remove_new	= au1100fb_drv_remove,
>   	.suspend	= au1100fb_drv_suspend,
> -        .resume		= au1100fb_drv_resume,
> +	.resume		= au1100fb_drv_resume,
>   };
>   module_platform_driver(au1100fb_driver);
>
> Feel free to squash this into 87be5a5d9a5c5b00505181eedbee62134f07d11d.
> If you want to apply it separately, either tell me to post a proper
> patch, or apply it under your name with my Suggested-by -- whatever
> suits you best.

I've squashed it into your patch.

Thanks!
Helge


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

end of thread, other threads:[~2023-05-30 16:36 UTC | newest]

Thread overview: 61+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-18 23:53 [PATCH 00/51] video: fbdev: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 01/51] video: fbdev: au1100fb: Drop if with an always false condition Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 02/51] video: fbdev: arcfb: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 03/51] video: fbdev: au1100fb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 04/51] video: fbdev: au1200fb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 05/51] video: fbdev: broadsheetfb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 06/51] video: fbdev: bw2: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 07/51] video: fbdev: cg14: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 08/51] video: fbdev: cg3: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 09/51] video: fbdev: cg6: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 10/51] video: fbdev: clps711x-fb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 11/51] video: fbdev: cobalt_lcdfb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 12/51] video: fbdev: da8xx-fb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 13/51] video: fbdev: efifb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 14/51] video: fbdev: ep93xx-fb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 15/51] video: fbdev: ffb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 16/51] video: fbdev: fsl-diu-fb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 17/51] video: fbdev: gbefb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 18/51] video: fbdev: goldfishfb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 19/51] video: fbdev: grvga: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 20/51] video: fbdev: hecubafb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 21/51] video: fbdev: hgafb: " Uwe Kleine-König
2023-03-18 23:53 ` [PATCH 22/51] video: fbdev: hitfb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 23/51] video: fbdev: imxfb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 24/51] video: fbdev: leo: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 25/51] video: fbdev: mb862xx: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 26/51] video: fbdev: metronomefb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 27/51] video: fbdev: mx3fb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 28/51] video: fbdev: ocfb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 29/51] video: fbdev: offb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 30/51] video: fbdev: omapfb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 31/51] video: fbdev: p9100: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 32/51] video: fbdev: platinumfb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 33/51] video: fbdev: pxa168fb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 34/51] video: fbdev: pxa3xx-gcu: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 35/51] video: fbdev: pxafb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 36/51] video: fbdev: s1d13xxxfb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 37/51] video: fbdev: s3c-fb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 38/51] video: fbdev: sh7760fb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 39/51] video: fbdev: sh_mobile_lcdcfb: " Uwe Kleine-König
2023-03-19  9:16   ` Geert Uytterhoeven
2023-03-18 23:54 ` [PATCH 40/51] video: fbdev: simplefb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 41/51] video: fbdev: sm501fb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 42/51] video: fbdev: tcx: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 43/51] video: fbdev: uvesafb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 44/51] video: fbdev: vesafb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 45/51] video: fbdev: vfb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 46/51] video: fbdev: vga16fb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 47/51] video: fbdev: via: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 48/51] video: fbdev: vt8500lcdfb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 49/51] video: fbdev: wm8505fb: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 50/51] video: fbdev: wmt_ge_rops: " Uwe Kleine-König
2023-03-18 23:54 ` [PATCH 51/51] video: fbdev: xilinxfb: " Uwe Kleine-König
2023-03-19 18:04 ` [PATCH 00/51] video: fbdev: " Helge Deller
2023-03-19 21:08   ` Uwe Kleine-König
2023-03-19 21:41     ` Helge Deller
2023-05-30 14:02   ` Uwe Kleine-König
2023-05-30 16:12     ` Helge Deller
2023-05-30 16:27       ` Uwe Kleine-König
2023-05-30 16:34         ` Helge Deller
2023-03-20 10:03 ` Thomas Zimmermann

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