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-pvi: 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>
Reviewed-by: Robert Foss <rfoss@kernel.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240304090555.716327-2-u.kleine-koenig@pengutronix.de

authored by

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

+2 -4
+2 -4
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c
··· 173 173 return 0; 174 174 } 175 175 176 - static int imx8mp_hdmi_pvi_remove(struct platform_device *pdev) 176 + static void imx8mp_hdmi_pvi_remove(struct platform_device *pdev) 177 177 { 178 178 struct imx8mp_hdmi_pvi *pvi = platform_get_drvdata(pdev); 179 179 180 180 drm_bridge_remove(&pvi->bridge); 181 181 182 182 pm_runtime_disable(&pdev->dev); 183 - 184 - return 0; 185 183 } 186 184 187 185 static const struct of_device_id imx8mp_hdmi_pvi_match[] = { ··· 193 195 194 196 static struct platform_driver imx8mp_hdmi_pvi_driver = { 195 197 .probe = imx8mp_hdmi_pvi_probe, 196 - .remove = imx8mp_hdmi_pvi_remove, 198 + .remove_new = imx8mp_hdmi_pvi_remove, 197 199 .driver = { 198 200 .name = "imx-hdmi-pvi", 199 201 .of_match_table = imx8mp_hdmi_pvi_match,