[PATCH 03/51] video: fbdev: au1100fb: Convert to platform remove callback returning void
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Sat Mar 18 23:53:40 UTC 2023
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 at 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
More information about the dri-devel
mailing list