Skip to content

Commit f3db09a

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: vesafb: 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 94bada5 commit f3db09a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/video/fbdev/vesafb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ static int vesafb_probe(struct platform_device *dev)
485485
return err;
486486
}
487487

488-
static int vesafb_remove(struct platform_device *pdev)
488+
static void vesafb_remove(struct platform_device *pdev)
489489
{
490490
struct fb_info *info = platform_get_drvdata(pdev);
491491

@@ -494,16 +494,14 @@ static int vesafb_remove(struct platform_device *pdev)
494494

495495
/* vesafb_destroy takes care of info cleanup */
496496
unregister_framebuffer(info);
497-
498-
return 0;
499497
}
500498

501499
static struct platform_driver vesafb_driver = {
502500
.driver = {
503501
.name = "vesa-framebuffer",
504502
},
505503
.probe = vesafb_probe,
506-
.remove = vesafb_remove,
504+
.remove_new = vesafb_remove,
507505
};
508506

509507
module_platform_driver(vesafb_driver);

0 commit comments

Comments
 (0)