]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fbdev: pxa168fb: Convert to platform remove callback returning void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sat, 18 Mar 2023 23:54:10 +0000 (00:54 +0100)
committerHelge Deller <deller@gmx.de>
Mon, 24 Apr 2023 09:48:31 +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/pxa168fb.c

index d5d0bbd39213bcd4c628d1bd6bec337b137a4841..79f3384630926139f71ffa97cb25789b693c4bba 100644 (file)
@@ -765,14 +765,14 @@ failed_free_info:
        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);