aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Uwe Kleine-König <u.kleine-koenig@pengutronix.de> 2023-11-02 17:56:51 +0100
committerGravatar Thomas Zimmermann <tzimmermann@suse.de> 2023-11-21 09:18:52 +0100
commita7e43c0a1a70e0d71fdda5d315927e1b3bc7e8d4 (patch)
treee05c601862939e9cc45f4cf58fee5661c6590f41
parentdrm/imx/dcss: Convert to platform remove callback returning void (diff)
downloadlinux-a7e43c0a1a70e0d71fdda5d315927e1b3bc7e8d4.tar.gz
linux-a7e43c0a1a70e0d71fdda5d315927e1b3bc7e8d4.tar.bz2
linux-a7e43c0a1a70e0d71fdda5d315927e1b3bc7e8d4.zip
drm/imx: lcdc: 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 <u.kleine-koenig@pengutronix.de> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20231102165640.3307820-28-u.kleine-koenig@pengutronix.de
-rw-r--r--drivers/gpu/drm/imx/lcdc/imx-lcdc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
index 22b65f4a0e30..0902983374d0 100644
--- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
+++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
@@ -515,14 +515,12 @@ static int imx_lcdc_probe(struct platform_device *pdev)
return 0;
}
-static int imx_lcdc_remove(struct platform_device *pdev)
+static void imx_lcdc_remove(struct platform_device *pdev)
{
struct drm_device *drm = platform_get_drvdata(pdev);
drm_dev_unregister(drm);
drm_atomic_helper_shutdown(drm);
-
- return 0;
}
static void imx_lcdc_shutdown(struct platform_device *pdev)
@@ -536,7 +534,7 @@ static struct platform_driver imx_lcdc_driver = {
.of_match_table = imx_lcdc_of_dev_id,
},
.probe = imx_lcdc_probe,
- .remove = imx_lcdc_remove,
+ .remove_new = imx_lcdc_remove,
.shutdown = imx_lcdc_shutdown,
};
module_platform_driver(imx_lcdc_driver);