[PATCH 34/51] video: fbdev: pxa3xx-gcu: Convert to platform remove callback returning void
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Sat Mar 18 23:54:11 UTC 2023
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.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
drivers/video/fbdev/pxa3xx-gcu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index c3cd1e1cc01b..2b6ec8c66074 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -676,7 +676,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
return ret;
}
-static int pxa3xx_gcu_remove(struct platform_device *pdev)
+static void pxa3xx_gcu_remove(struct platform_device *pdev)
{
struct pxa3xx_gcu_priv *priv = platform_get_drvdata(pdev);
struct device *dev = &pdev->dev;
@@ -686,8 +686,6 @@ static int pxa3xx_gcu_remove(struct platform_device *pdev)
dma_free_coherent(dev, SHARED_SIZE, priv->shared, priv->shared_phys);
clk_disable_unprepare(priv->clk);
pxa3xx_gcu_free_buffers(dev, priv);
-
- return 0;
}
#ifdef CONFIG_OF
@@ -700,7 +698,7 @@ MODULE_DEVICE_TABLE(of, pxa3xx_gcu_of_match);
static struct platform_driver pxa3xx_gcu_driver = {
.probe = pxa3xx_gcu_probe,
- .remove = pxa3xx_gcu_remove,
+ .remove_new = pxa3xx_gcu_remove,
.driver = {
.name = DRV_NAME,
.of_match_table = of_match_ptr(pxa3xx_gcu_of_match),
--
2.39.2
More information about the dri-devel
mailing list