]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fbdev: s3c-fb: Convert to platform remove callback returning void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sat, 18 Mar 2023 23:54:14 +0000 (00:54 +0100)
committerHelge Deller <deller@gmx.de>
Mon, 24 Apr 2023 09:48:32 +0000 (11:48 +0200)
The .remove() callback for a platform driver returns an int 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>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/s3c-fb.c

index 3abbc5737c3b37001841429e2fbf234e411ef646..1ce707e4cfd03e0bb1b8dcc5499977b55ce8239b 100644 (file)
@@ -1507,7 +1507,7 @@ err_bus_clk:
  * 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",