Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <u.kleine-koenig@pengutronix.de>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Uwe Kleine-König and committed by
Helge Deller
2e2389ca a23f29d0

+2 -4
+2 -4
drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c
··· 283 283 return r; 284 284 } 285 285 286 - static int tpd_remove(struct platform_device *pdev) 286 + static void tpd_remove(struct platform_device *pdev) 287 287 { 288 288 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 289 289 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 300 300 tpd_disconnect(dssdev, dssdev->dst); 301 301 302 302 omap_dss_put_device(in); 303 - 304 - return 0; 305 303 } 306 304 307 305 static const struct of_device_id tpd_of_match[] = { ··· 311 313 312 314 static struct platform_driver tpd_driver = { 313 315 .probe = tpd_probe, 314 - .remove = tpd_remove, 316 + .remove_new = tpd_remove, 315 317 .driver = { 316 318 .name = "tpd12s015", 317 319 .of_match_table = tpd_of_match,