summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/omap/omapfb_main.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-03-19 02:54:07 +0300
committerHelge Deller <deller@gmx.de>2023-04-24 12:48:31 +0300
commitdc6b77badc752e4965919f7b81ad9e3725ae0a64 (patch)
treebddc484a9ba77d32d3c276048230ccde72531424 /drivers/video/fbdev/omap/omapfb_main.c
parentdb031426eb4680137f023d75fdb3646664227335 (diff)
downloadlinux-dc6b77badc752e4965919f7b81ad9e3725ae0a64.tar.xz
fbdev: omapfb: Convert to platform remove callback returning void
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>
Diffstat (limited to 'drivers/video/fbdev/omap/omapfb_main.c')
-rw-r--r--drivers/video/fbdev/omap/omapfb_main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
index 18736079843d..ad65554b33c3 100644
--- a/drivers/video/fbdev/omap/omapfb_main.c
+++ b/drivers/video/fbdev/omap/omapfb_main.c
@@ -1799,7 +1799,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;
@@ -1811,8 +1811,6 @@ static int omapfb_remove(struct platform_device *pdev)
platform_device_unregister(&omapdss_device);
fbdev->dssdev = NULL;
-
- return 0;
}
/* PM suspend */
@@ -1837,7 +1835,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 = {