Skip to content

Commit 89c4bbd

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: wmt_ge_rops: 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 024a3ca commit 89c4bbd

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/video/fbdev/wmt_ge_rops.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,9 @@ static int wmt_ge_rops_probe(struct platform_device *pdev)
145145
return 0;
146146
}
147147

148-
static int wmt_ge_rops_remove(struct platform_device *pdev)
148+
static void wmt_ge_rops_remove(struct platform_device *pdev)
149149
{
150150
iounmap(regbase);
151-
return 0;
152151
}
153152

154153
static const struct of_device_id wmt_dt_ids[] = {
@@ -158,7 +157,7 @@ static const struct of_device_id wmt_dt_ids[] = {
158157

159158
static struct platform_driver wmt_ge_rops_driver = {
160159
.probe = wmt_ge_rops_probe,
161-
.remove = wmt_ge_rops_remove,
160+
.remove_new = wmt_ge_rops_remove,
162161
.driver = {
163162
.name = "wmt_ge_rops",
164163
.of_match_table = wmt_dt_ids,

0 commit comments

Comments
 (0)