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

Configure Feed

Select the types of activity you want to include in your feed.

drm/imx: lcdc: 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-28-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Thomas Zimmermann
a7e43c0a 60096f0a

+2 -4
+2 -4
drivers/gpu/drm/imx/lcdc/imx-lcdc.c
··· 515 515 return 0; 516 516 } 517 517 518 - static int imx_lcdc_remove(struct platform_device *pdev) 518 + static void imx_lcdc_remove(struct platform_device *pdev) 519 519 { 520 520 struct drm_device *drm = platform_get_drvdata(pdev); 521 521 522 522 drm_dev_unregister(drm); 523 523 drm_atomic_helper_shutdown(drm); 524 - 525 - return 0; 526 524 } 527 525 528 526 static void imx_lcdc_shutdown(struct platform_device *pdev) ··· 534 536 .of_match_table = imx_lcdc_of_dev_id, 535 537 }, 536 538 .probe = imx_lcdc_probe, 537 - .remove = imx_lcdc_remove, 539 + .remove_new = imx_lcdc_remove, 538 540 .shutdown = imx_lcdc_shutdown, 539 541 }; 540 542 module_platform_driver(imx_lcdc_driver);