From 068240885346a4f484237e24dc1f75530a58c370 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Sun, 19 Mar 2023 00:54:16 +0100 Subject: fbdev: sh_mobile_lcdcfb: Convert to platform remove callback returning void MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Geert Uytterhoeven Signed-off-by: Helge Deller --- drivers/video/fbdev/sh_mobile_lcdcfb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index ad9323ed8e2e..093f035d1246 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -2249,7 +2249,7 @@ static const struct fb_videomode default_720p = { .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, }; -static int sh_mobile_lcdc_remove(struct platform_device *pdev) +static void sh_mobile_lcdc_remove(struct platform_device *pdev) { struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev); unsigned int i; @@ -2305,7 +2305,6 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) if (priv->irq) free_irq(priv->irq, priv); kfree(priv); - return 0; } static int sh_mobile_lcdc_check_interface(struct sh_mobile_lcdc_chan *ch) @@ -2656,7 +2655,7 @@ static struct platform_driver sh_mobile_lcdc_driver = { .pm = &sh_mobile_lcdc_dev_pm_ops, }, .probe = sh_mobile_lcdc_probe, - .remove = sh_mobile_lcdc_remove, + .remove_new = sh_mobile_lcdc_remove, }; module_platform_driver(sh_mobile_lcdc_driver); -- cgit v1.2.3