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

drm/meson: 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: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20231102165640.3307820-31-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Thomas Zimmermann
ac965557 30b749ad

+2 -4
+2 -4
drivers/gpu/drm/meson/meson_dw_mipi_dsi.c
··· 323 323 return 0; 324 324 } 325 325 326 - static int meson_dw_mipi_dsi_remove(struct platform_device *pdev) 326 + static void meson_dw_mipi_dsi_remove(struct platform_device *pdev) 327 327 { 328 328 struct meson_dw_mipi_dsi *mipi_dsi = platform_get_drvdata(pdev); 329 329 330 330 dw_mipi_dsi_remove(mipi_dsi->dmd); 331 - 332 - return 0; 333 331 } 334 332 335 333 static const struct of_device_id meson_dw_mipi_dsi_of_table[] = { ··· 338 340 339 341 static struct platform_driver meson_dw_mipi_dsi_platform_driver = { 340 342 .probe = meson_dw_mipi_dsi_probe, 341 - .remove = meson_dw_mipi_dsi_remove, 343 + .remove_new = meson_dw_mipi_dsi_remove, 342 344 .driver = { 343 345 .name = DRIVER_NAME, 344 346 .of_match_table = meson_dw_mipi_dsi_of_table,