Skip to content

Commit 2e2389c

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: omapfb/tpd12s015: 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]> Signed-off-by: Helge Deller <[email protected]>
1 parent a23f29d commit 2e2389c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ static int tpd_probe(struct platform_device *pdev)
283283
return r;
284284
}
285285

286-
static int tpd_remove(struct platform_device *pdev)
286+
static void tpd_remove(struct platform_device *pdev)
287287
{
288288
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
289289
struct omap_dss_device *dssdev = &ddata->dssdev;
@@ -300,8 +300,6 @@ static int tpd_remove(struct platform_device *pdev)
300300
tpd_disconnect(dssdev, dssdev->dst);
301301

302302
omap_dss_put_device(in);
303-
304-
return 0;
305303
}
306304

307305
static const struct of_device_id tpd_of_match[] = {
@@ -313,7 +311,7 @@ MODULE_DEVICE_TABLE(of, tpd_of_match);
313311

314312
static struct platform_driver tpd_driver = {
315313
.probe = tpd_probe,
316-
.remove = tpd_remove,
314+
.remove_new = tpd_remove,
317315
.driver = {
318316
.name = "tpd12s015",
319317
.of_match_table = tpd_of_match,

0 commit comments

Comments
 (0)