Skip to content

Commit a3ce8c8

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: broadsheetfb: 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 <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 4b88b6e commit a3ce8c8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/video/fbdev/broadsheetfb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ static int broadsheetfb_probe(struct platform_device *dev)
11931193

11941194
}
11951195

1196-
static int broadsheetfb_remove(struct platform_device *dev)
1196+
static void broadsheetfb_remove(struct platform_device *dev)
11971197
{
11981198
struct fb_info *info = platform_get_drvdata(dev);
11991199

@@ -1209,12 +1209,11 @@ static int broadsheetfb_remove(struct platform_device *dev)
12091209
module_put(par->board->owner);
12101210
framebuffer_release(info);
12111211
}
1212-
return 0;
12131212
}
12141213

12151214
static struct platform_driver broadsheetfb_driver = {
12161215
.probe = broadsheetfb_probe,
1217-
.remove = broadsheetfb_remove,
1216+
.remove_new = broadsheetfb_remove,
12181217
.driver = {
12191218
.name = "broadsheetfb",
12201219
},

0 commit comments

Comments
 (0)