Skip to content

Commit 29b3967

Browse files
Uwe Kleine-Königrobertfoss
authored andcommitted
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 <[email protected]> Reviewed-by: Robert Foss <[email protected]> Signed-off-by: Robert Foss <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent fb24c13 commit 29b3967

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,13 @@ static int imx8mp_hdmi_pvi_probe(struct platform_device *pdev)
173173
return 0;
174174
}
175175

176-
static int imx8mp_hdmi_pvi_remove(struct platform_device *pdev)
176+
static void imx8mp_hdmi_pvi_remove(struct platform_device *pdev)
177177
{
178178
struct imx8mp_hdmi_pvi *pvi = platform_get_drvdata(pdev);
179179

180180
drm_bridge_remove(&pvi->bridge);
181181

182182
pm_runtime_disable(&pdev->dev);
183-
184-
return 0;
185183
}
186184

187185
static const struct of_device_id imx8mp_hdmi_pvi_match[] = {
@@ -195,7 +193,7 @@ MODULE_DEVICE_TABLE(of, imx8mp_hdmi_pvi_match);
195193

196194
static struct platform_driver imx8mp_hdmi_pvi_driver = {
197195
.probe = imx8mp_hdmi_pvi_probe,
198-
.remove = imx8mp_hdmi_pvi_remove,
196+
.remove_new = imx8mp_hdmi_pvi_remove,
199197
.driver = {
200198
.name = "imx-hdmi-pvi",
201199
.of_match_table = imx8mp_hdmi_pvi_match,

0 commit comments

Comments
 (0)