summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vc4/vc4_dpi.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-05-07 18:26:15 +0200
committerDouglas Anderson <dianders@chromium.org>2023-06-08 09:04:13 -0700
commit1ed54a19f3b3c78b27621b9f80badd8087339c47 (patch)
treef9921ca3f33519de53e90aee0985e6da98b8084e /drivers/gpu/drm/vc4/vc4_dpi.c
parentb957812839f87d83cf8189818da73d84df6f263f (diff)
downloadlinux-1ed54a19f3b3c78b27621b9f80badd8087339c47.tar.gz
linux-1ed54a19f3b3c78b27621b9f80badd8087339c47.tar.bz2
linux-1ed54a19f3b3c78b27621b9f80badd8087339c47.zip
drm/vc4: 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. Trivially convert the vc4 drm drivers 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: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-53-u.kleine-koenig@pengutronix.de
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_dpi.c')
-rw-r--r--drivers/gpu/drm/vc4/vc4_dpi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index e68c07d86040..366c28ae2396 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -388,15 +388,14 @@ static int vc4_dpi_dev_probe(struct platform_device *pdev)
return component_add(&pdev->dev, &vc4_dpi_ops);
}
-static int vc4_dpi_dev_remove(struct platform_device *pdev)
+static void vc4_dpi_dev_remove(struct platform_device *pdev)
{
component_del(&pdev->dev, &vc4_dpi_ops);
- return 0;
}
struct platform_driver vc4_dpi_driver = {
.probe = vc4_dpi_dev_probe,
- .remove = vc4_dpi_dev_remove,
+ .remove_new = vc4_dpi_dev_remove,
.driver = {
.name = "vc4_dpi",
.of_match_table = vc4_dpi_dt_match,