Skip to content

Commit 07d0355

Browse files
Uwe Kleine-Königandy-shev
authored andcommitted
auxdisplay: cfag12864bfb: 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]> Acked-by: Miguel Ojeda <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent d8abf9d commit 07d0355

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/auxdisplay/cfag12864bfb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,19 @@ static int cfag12864bfb_probe(struct platform_device *device)
9696
return ret;
9797
}
9898

99-
static int cfag12864bfb_remove(struct platform_device *device)
99+
static void cfag12864bfb_remove(struct platform_device *device)
100100
{
101101
struct fb_info *info = platform_get_drvdata(device);
102102

103103
if (info) {
104104
unregister_framebuffer(info);
105105
framebuffer_release(info);
106106
}
107-
108-
return 0;
109107
}
110108

111109
static struct platform_driver cfag12864bfb_driver = {
112110
.probe = cfag12864bfb_probe,
113-
.remove = cfag12864bfb_remove,
111+
.remove_new = cfag12864bfb_remove,
114112
.driver = {
115113
.name = CFAG12864BFB_NAME,
116114
},

0 commit comments

Comments
 (0)