summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-10-26 23:44:08 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-27 13:10:11 +0200
commitb83b7368258aeb5104c2ff7331326bfeefea9370 (patch)
tree05bb58d7f10c2e5d980450438757d163b7c3b6f8
parent0210a684cdb277714380553f8d8d8964b2f744fc (diff)
staging: fbtft: 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 (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. The function fbtft_driver_remove_pdev() (that exists several times as it's part of a macro expansion) returns zero unconditionally, so it can be trivially converted to return void without semantic changes. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231026214407.2508590-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/fbtft/fbtft.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
index 2c2b5f1c1df3..f86ed9d470b8 100644
--- a/drivers/staging/fbtft/fbtft.h
+++ b/drivers/staging/fbtft/fbtft.h
@@ -310,12 +310,11 @@ static int fbtft_driver_probe_pdev(struct platform_device *pdev) \
return fbtft_probe_common(_display, NULL, pdev); \
} \
\
-static int fbtft_driver_remove_pdev(struct platform_device *pdev) \
+static void fbtft_driver_remove_pdev(struct platform_device *pdev) \
{ \
struct fb_info *info = platform_get_drvdata(pdev); \
\
fbtft_remove_common(&pdev->dev, info); \
- return 0; \
} \
\
FBTFT_DT_TABLE(_compatible) \
@@ -329,7 +328,7 @@ static struct platform_driver fbtft_driver_platform_driver = { \
.of_match_table = dt_ids, \
}, \
.probe = fbtft_driver_probe_pdev, \
- .remove = fbtft_driver_remove_pdev, \
+ .remove_new = fbtft_driver_remove_pdev, \
}; \
\
static int __init fbtft_driver_module_init(void) \