Skip to content

Commit 34948a3

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

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ static int hdmic_probe(struct platform_device *pdev)
249249
return r;
250250
}
251251

252-
static int hdmic_remove(struct platform_device *pdev)
252+
static void hdmic_remove(struct platform_device *pdev)
253253
{
254254
struct panel_drv_data *ddata = platform_get_drvdata(pdev);
255255
struct omap_dss_device *dssdev = &ddata->dssdev;
@@ -261,8 +261,6 @@ static int hdmic_remove(struct platform_device *pdev)
261261
hdmic_disconnect(dssdev);
262262

263263
omap_dss_put_device(in);
264-
265-
return 0;
266264
}
267265

268266
static const struct of_device_id hdmic_of_match[] = {
@@ -274,7 +272,7 @@ MODULE_DEVICE_TABLE(of, hdmic_of_match);
274272

275273
static struct platform_driver hdmi_connector_driver = {
276274
.probe = hdmic_probe,
277-
.remove = hdmic_remove,
275+
.remove_new = hdmic_remove,
278276
.driver = {
279277
.name = "connector-hdmi",
280278
.of_match_table = hdmic_of_match,

0 commit comments

Comments
 (0)