drm/imx/ipuv3: Convert to platform remove callback returning void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sun, 7 May 2023 16:25:45 +0000 (18:25 +0200)
committerJavier Martinez Canillas <javierm@redhat.com>
Sat, 9 Sep 2023 14:04:40 +0000 (16:04 +0200)
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 ipuv3 imx 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: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-23-u.kleine-koenig@pengutronix.de
drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c
drivers/gpu/drm/imx/ipuv3/imx-drm-core.c
drivers/gpu/drm/imx/ipuv3/imx-ldb.c
drivers/gpu/drm/imx/ipuv3/imx-tve.c
drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c
drivers/gpu/drm/imx/ipuv3/parallel-display.c

index a2277a0d6d06fb55f129531b1e7dd660e269113f..0006ea52b83c5902d48ca859ed89cfeb48edc61e 100644 (file)
@@ -255,19 +255,17 @@ static int dw_hdmi_imx_probe(struct platform_device *pdev)
        return ret;
 }
 
-static int dw_hdmi_imx_remove(struct platform_device *pdev)
+static void dw_hdmi_imx_remove(struct platform_device *pdev)
 {
        struct imx_hdmi *hdmi = platform_get_drvdata(pdev);
 
        component_del(&pdev->dev, &dw_hdmi_imx_ops);
        dw_hdmi_remove(hdmi->hdmi);
-
-       return 0;
 }
 
 static struct platform_driver dw_hdmi_imx_platform_driver = {
        .probe  = dw_hdmi_imx_probe,
-       .remove = dw_hdmi_imx_remove,
+       .remove_new = dw_hdmi_imx_remove,
        .driver = {
                .name = "dwhdmi-imx",
                .of_match_table = dw_hdmi_imx_dt_ids,
index 4a866ac60fffa22fb31e212ccbae1e826126fc17..352fa31ab4ed7394a3f17348e43787eab0b7dbbc 100644 (file)
@@ -292,10 +292,9 @@ static int imx_drm_platform_probe(struct platform_device *pdev)
        return ret;
 }
 
-static int imx_drm_platform_remove(struct platform_device *pdev)
+static void imx_drm_platform_remove(struct platform_device *pdev)
 {
        component_master_del(&pdev->dev, &imx_drm_ops);
-       return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -324,7 +323,7 @@ MODULE_DEVICE_TABLE(of, imx_drm_dt_ids);
 
 static struct platform_driver imx_drm_pdrv = {
        .probe          = imx_drm_platform_probe,
-       .remove         = imx_drm_platform_remove,
+       .remove_new     = imx_drm_platform_remove,
        .driver         = {
                .name   = "imx-drm",
                .pm     = &imx_drm_pm_ops,
index c45fc8f4744d01715425cb6d0e8af8f8aa217dac..989eca32d3252a15a8a790cc425c493a6d48a69b 100644 (file)
@@ -737,7 +737,7 @@ free_child:
        return ret;
 }
 
-static int imx_ldb_remove(struct platform_device *pdev)
+static void imx_ldb_remove(struct platform_device *pdev)
 {
        struct imx_ldb *imx_ldb = platform_get_drvdata(pdev);
        int i;
@@ -750,12 +750,11 @@ static int imx_ldb_remove(struct platform_device *pdev)
        }
 
        component_del(&pdev->dev, &imx_ldb_ops);
-       return 0;
 }
 
 static struct platform_driver imx_ldb_driver = {
        .probe          = imx_ldb_probe,
-       .remove         = imx_ldb_remove,
+       .remove_new     = imx_ldb_remove,
        .driver         = {
                .of_match_table = imx_ldb_dt_ids,
                .name   = DRIVER_NAME,
index d6832f506322cd585cbf88567ceeedf3fbedc742..b49bddb85535ccd7b058c11244ffa5b5a40faaf3 100644 (file)
@@ -645,10 +645,9 @@ static int imx_tve_probe(struct platform_device *pdev)
        return component_add(dev, &imx_tve_ops);
 }
 
-static int imx_tve_remove(struct platform_device *pdev)
+static void imx_tve_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &imx_tve_ops);
-       return 0;
 }
 
 static const struct of_device_id imx_tve_dt_ids[] = {
@@ -659,7 +658,7 @@ MODULE_DEVICE_TABLE(of, imx_tve_dt_ids);
 
 static struct platform_driver imx_tve_driver = {
        .probe          = imx_tve_probe,
-       .remove         = imx_tve_remove,
+       .remove_new     = imx_tve_remove,
        .driver         = {
                .of_match_table = imx_tve_dt_ids,
                .name   = "imx-tve",
index 5f26090b0c9850a541d563d0648e103a50f72816..8819e40d5e6ed3bc7fe8fd2ac20151f59ceb3c7a 100644 (file)
@@ -441,10 +441,9 @@ static int ipu_drm_probe(struct platform_device *pdev)
        return component_add(dev, &ipu_crtc_ops);
 }
 
-static int ipu_drm_remove(struct platform_device *pdev)
+static void ipu_drm_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &ipu_crtc_ops);
-       return 0;
 }
 
 struct platform_driver ipu_drm_driver = {
@@ -452,5 +451,5 @@ struct platform_driver ipu_drm_driver = {
                .name = "imx-ipuv3-crtc",
        },
        .probe = ipu_drm_probe,
-       .remove = ipu_drm_remove,
+       .remove_new = ipu_drm_remove,
 };
index 0fa0b590830b6642b1e13d3facdaf9e6a3d033bd..70349739dd89bed615e221fb00900fc4b53b496d 100644 (file)
@@ -353,11 +353,9 @@ static int imx_pd_probe(struct platform_device *pdev)
        return component_add(dev, &imx_pd_ops);
 }
 
-static int imx_pd_remove(struct platform_device *pdev)
+static void imx_pd_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &imx_pd_ops);
-
-       return 0;
 }
 
 static const struct of_device_id imx_pd_dt_ids[] = {
@@ -368,7 +366,7 @@ MODULE_DEVICE_TABLE(of, imx_pd_dt_ids);
 
 static struct platform_driver imx_pd_driver = {
        .probe          = imx_pd_probe,
-       .remove         = imx_pd_remove,
+       .remove_new     = imx_pd_remove,
        .driver         = {
                .of_match_table = imx_pd_dt_ids,
                .name   = "imx-parallel-display",