Skip to content

Commit ebfb133

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: omapfb/dvi: 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 da21ff3 commit ebfb133

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int dvic_probe(struct platform_device *pdev)
303303
return r;
304304
}
305305

306-
static int dvic_remove(struct platform_device *pdev)
306+
static void dvic_remove(struct platform_device *pdev)
307307
{
308308
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
309309
struct omap_dss_device *dssdev = &ddata->dssdev;
@@ -317,8 +317,6 @@ static int dvic_remove(struct platform_device *pdev)
317317
omap_dss_put_device(in);
318318

319319
i2c_put_adapter(ddata->i2c_adapter);
320-
321-
return 0;
322320
}
323321

324322
static const struct of_device_id dvic_of_match[] = {
@@ -330,7 +328,7 @@ MODULE_DEVICE_TABLE(of, dvic_of_match);
330328

331329
static struct platform_driver dvi_connector_driver = {
332330
.probe = dvic_probe,
333-
.remove = dvic_remove,
331+
.remove_new = dvic_remove,
334332
.driver = {
335333
.name = "connector-dvi",
336334
.of_match_table = dvic_of_match,

0 commit comments

Comments
 (0)