From: Uwe Kleine-König Date: Sat, 18 Mar 2023 23:53:49 +0000 (+0100) Subject: fbdev: da8xx-fb: Convert to platform remove callback returning void X-Git-Tag: v6.6.17~5007^2~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33c890d022f91d7807cc9673f7017b480f64b2cf;p=platform%2Fkernel%2Flinux-rpi.git fbdev: da8xx-fb: 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 Signed-off-by: Helge Deller --- diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index cd07e40..60cd128 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,