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

drm/kmb: 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 (mostly) ignored
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.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jyri Sarha <jyri.sarha@iki.fi>
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-29-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Thomas Zimmermann
8c67c9a4 a7e43c0a

+2 -3
+2 -3
drivers/gpu/drm/kmb/kmb_drv.c
··· 448 448 .minor = DRIVER_MINOR, 449 449 }; 450 450 451 - static int kmb_remove(struct platform_device *pdev) 451 + static void kmb_remove(struct platform_device *pdev) 452 452 { 453 453 struct device *dev = &pdev->dev; 454 454 struct drm_device *drm = dev_get_drvdata(dev); ··· 473 473 /* Unregister DSI host */ 474 474 kmb_dsi_host_unregister(kmb->kmb_dsi); 475 475 drm_atomic_helper_shutdown(drm); 476 - return 0; 477 476 } 478 477 479 478 static int kmb_probe(struct platform_device *pdev) ··· 620 621 621 622 static struct platform_driver kmb_platform_driver = { 622 623 .probe = kmb_probe, 623 - .remove = kmb_remove, 624 + .remove_new = kmb_remove, 624 625 .driver = { 625 626 .name = "kmb-drm", 626 627 .pm = &kmb_pm_ops,