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

fbdev: omapfb/tfp410: 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
a23f29d0 b0d61e8c

+2 -4
+2 -4
drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c
··· 217 217 return r; 218 218 } 219 219 220 - static int tfp410_remove(struct platform_device *pdev) 220 + static void tfp410_remove(struct platform_device *pdev) 221 221 { 222 222 struct panel_drv_data *ddata = platform_get_drvdata(pdev); 223 223 struct omap_dss_device *dssdev = &ddata->dssdev; ··· 234 234 tfp410_disconnect(dssdev, dssdev->dst); 235 235 236 236 omap_dss_put_device(in); 237 - 238 - return 0; 239 237 } 240 238 241 239 static const struct of_device_id tfp410_of_match[] = { ··· 245 247 246 248 static struct platform_driver tfp410_driver = { 247 249 .probe = tfp410_probe, 248 - .remove = tfp410_remove, 250 + .remove_new = tfp410_remove, 249 251 .driver = { 250 252 .name = "tfp410", 251 253 .of_match_table = tfp410_of_match,