Skip to content

Commit 24f6770

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: vfb: 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>
1 parent f3db09a commit 24f6770

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/video/fbdev/vfb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ static int vfb_probe(struct platform_device *dev)
479479
return retval;
480480
}
481481

482-
static int vfb_remove(struct platform_device *dev)
482+
static void vfb_remove(struct platform_device *dev)
483483
{
484484
struct fb_info *info = platform_get_drvdata(dev);
485485

@@ -489,12 +489,11 @@ static int vfb_remove(struct platform_device *dev)
489489
fb_dealloc_cmap(&info->cmap);
490490
framebuffer_release(info);
491491
}
492-
return 0;
493492
}
494493

495494
static struct platform_driver vfb_driver = {
496495
.probe = vfb_probe,
497-
.remove = vfb_remove,
496+
.remove_new = vfb_remove,
498497
.driver = {
499498
.name = "vfb",
500499
},

0 commit comments

Comments
 (0)