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/bridge: imx8mp-hdmi-tx: 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: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240304091005.717012-2-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Robert Foss
2caad4f7 29b39672

+2 -4
+2 -4
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
··· 104 104 return 0; 105 105 } 106 106 107 - static int imx8mp_dw_hdmi_remove(struct platform_device *pdev) 107 + static void imx8mp_dw_hdmi_remove(struct platform_device *pdev) 108 108 { 109 109 struct imx8mp_hdmi *hdmi = platform_get_drvdata(pdev); 110 110 111 111 dw_hdmi_remove(hdmi->dw_hdmi); 112 - 113 - return 0; 114 112 } 115 113 116 114 static int __maybe_unused imx8mp_dw_hdmi_pm_suspend(struct device *dev) ··· 138 140 139 141 static struct platform_driver imx8mp_dw_hdmi_platform_driver = { 140 142 .probe = imx8mp_dw_hdmi_probe, 141 - .remove = imx8mp_dw_hdmi_remove, 143 + .remove_new = imx8mp_dw_hdmi_remove, 142 144 .driver = { 143 145 .name = "imx8mp-dw-hdmi-tx", 144 146 .of_match_table = imx8mp_dw_hdmi_of_table,