<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Uwe Kleine-König <<a href="mailto:u.kleine-koenig@pengutronix.de">u.kleine-koenig@pengutronix.de</a>> schrieb am Di., 1. Aug. 2023, 13:02:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The .remove() callback for a platform driver returns an int which makes<br>
many driver authors wrongly assume it's possible to do error handling by<br>
returning an error code. However the value returned is (mostly) ignored<br>
and this typically results in resource leaks. To improve here there is a<br>
quest to make the remove callback return void. In the first step of this<br>
quest all drivers are converted to .remove_new() which already returns<br>
void.<br>
<br>
Trivially convert the etnaviv drm driver from always returning zero in<br>
the remove callback to the void returning variant.<br>
<br>
Reviewed-by: Thomas Zimmermann <<a href="mailto:tzimmermann@suse.de" target="_blank" rel="noreferrer">tzimmermann@suse.de</a>><br>
Reviewed-by: Jyri Sarha <<a href="mailto:jyri.sarha@iki.fi" target="_blank" rel="noreferrer">jyri.sarha@iki.fi</a>><br>
Signed-off-by: Uwe Kleine-König <<a href="mailto:u.kleine-koenig@pengutronix.de" target="_blank" rel="noreferrer">u.kleine-koenig@pengutronix.de</a>><br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Reviewed-by: Christian Gmeiner <<a href="mailto:cgmeiner@igalia.com">cgmeiner@igalia.com</a>></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
drivers/gpu/drm/etnaviv/etnaviv_drv.c | 6 ++----<br>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 5 ++---<br>
2 files changed, 4 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c<br>
index ea55f6b7b744..20305df01b57 100644<br>
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c<br>
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c<br>
@@ -638,16 +638,14 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)<br>
return component_master_add_with_match(dev, &etnaviv_master_ops, match);<br>
}<br>
<br>
-static int etnaviv_pdev_remove(struct platform_device *pdev)<br>
+static void etnaviv_pdev_remove(struct platform_device *pdev)<br>
{<br>
component_master_del(&pdev->dev, &etnaviv_master_ops);<br>
-<br>
- return 0;<br>
}<br>
<br>
static struct platform_driver etnaviv_platform_driver = {<br>
.probe = etnaviv_pdev_probe,<br>
- .remove = etnaviv_pdev_remove,<br>
+ .remove_new = etnaviv_pdev_remove,<br>
.driver = {<br>
.name = "etnaviv",<br>
},<br>
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c<br>
index bbc9c54871f4..43426ffe4d77 100644<br>
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c<br>
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c<br>
@@ -1892,11 +1892,10 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev)<br>
return 0;<br>
}<br>
<br>
-static int etnaviv_gpu_platform_remove(struct platform_device *pdev)<br>
+static void etnaviv_gpu_platform_remove(struct platform_device *pdev)<br>
{<br>
component_del(&pdev->dev, &gpu_ops);<br>
pm_runtime_disable(&pdev->dev);<br>
- return 0;<br>
}<br>
<br>
static int etnaviv_gpu_rpm_suspend(struct device *dev)<br>
@@ -1954,6 +1953,6 @@ struct platform_driver etnaviv_gpu_driver = {<br>
.of_match_table = etnaviv_gpu_match,<br>
},<br>
.probe = etnaviv_gpu_platform_probe,<br>
- .remove = etnaviv_gpu_platform_remove,<br>
+ .remove_new = etnaviv_gpu_platform_remove,<br>
.id_table = gpu_ids,<br>
};<br>
-- <br>
2.39.2<br>
<br>
</blockquote></div></div></div>