Skip to content

Commit 42a0148

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: atmel_lcdfb: 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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 3e9ec97 commit 42a0148

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/video/fbdev/atmel_lcdfb.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,14 +1223,14 @@ static int atmel_lcdfb_probe(struct platform_device *pdev)
12231223
return ret;
12241224
}
12251225

1226-
static int atmel_lcdfb_remove(struct platform_device *pdev)
1226+
static void atmel_lcdfb_remove(struct platform_device *pdev)
12271227
{
12281228
struct device *dev = &pdev->dev;
12291229
struct fb_info *info = dev_get_drvdata(dev);
12301230
struct atmel_lcdfb_info *sinfo;
12311231

12321232
if (!info || !info->par)
1233-
return 0;
1233+
return;
12341234
sinfo = info->par;
12351235

12361236
cancel_work_sync(&sinfo->task);
@@ -1252,8 +1252,6 @@ static int atmel_lcdfb_remove(struct platform_device *pdev)
12521252
}
12531253

12541254
framebuffer_release(info);
1255-
1256-
return 0;
12571255
}
12581256

12591257
#ifdef CONFIG_PM
@@ -1302,7 +1300,7 @@ static int atmel_lcdfb_resume(struct platform_device *pdev)
13021300

13031301
static struct platform_driver atmel_lcdfb_driver = {
13041302
.probe = atmel_lcdfb_probe,
1305-
.remove = atmel_lcdfb_remove,
1303+
.remove_new = atmel_lcdfb_remove,
13061304
.suspend = atmel_lcdfb_suspend,
13071305
.resume = atmel_lcdfb_resume,
13081306
.driver = {

0 commit comments

Comments
 (0)