Skip to content

Commit dce2177

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: amifb: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 67e1ab5 commit dce2177

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/video/fbdev/amifb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3752,7 +3752,7 @@ static int __init amifb_probe(struct platform_device *pdev)
37523752
}
37533753

37543754

3755-
static int __exit amifb_remove(struct platform_device *pdev)
3755+
static void __exit amifb_remove(struct platform_device *pdev)
37563756
{
37573757
struct fb_info *info = platform_get_drvdata(pdev);
37583758

@@ -3765,7 +3765,6 @@ static int __exit amifb_remove(struct platform_device *pdev)
37653765
chipfree();
37663766
framebuffer_release(info);
37673767
amifb_video_off();
3768-
return 0;
37693768
}
37703769

37713770
/*
@@ -3775,7 +3774,7 @@ static int __exit amifb_remove(struct platform_device *pdev)
37753774
* triggers a section mismatch warning.
37763775
*/
37773776
static struct platform_driver amifb_driver __refdata = {
3778-
.remove = __exit_p(amifb_remove),
3777+
.remove_new = __exit_p(amifb_remove),
37793778
.driver = {
37803779
.name = "amiga-video",
37813780
},

0 commit comments

Comments
 (0)