<div dir="auto"><div>Hi,</div><div dir="auto"><br></div><div dir="auto">Sorry for late. There was a merge conflict so I fixed it manually and merged. And seems your patch description is duplicated so dropped duplicated one.</div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto">Inki Dae<br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">2023년 11월 3일 (금) 오전 1:57, Uwe Kleine-König <<a href="mailto:u.kleine-koenig@pengutronix.de">u.kleine-koenig@pengutronix.de</a>>님이 작성:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The .remove() callback for a platform driver returns an int which makes<br>
many driver authors wrongly assume it's possible to do error handling by<br>
returning an error code. However the value returned is ignored (apart<br>
from emitting a warning) and this typically results in resource leaks.<br>
<br>
To improve here there is a quest to make the remove callback return<br>
void. In the first step of this quest all drivers are converted to<br>
.remove_new(), which already returns void. Eventually after all drivers<br>
are converted, .remove_new() will be renamed to .remove().<br>
<br>
Trivially convert the exynos drivers from always returning zero in the<br>
remove callback to the void returning variant.<br>
<br>
Signed-off-by: Uwe Kleine-König <<a href="mailto:u.kleine-koenig@pengutronix.de" target="_blank" rel="noreferrer">u.kleine-koenig@pengutronix.de</a>><br>
<br>
drivers/gpu/drm/exynos/exynos_mixer.c :: Convert to platform remove callback returning void<br>
<br>
The .remove() callback for a platform driver returns an int which makes<br>
many driver authors wrongly assume it's possible to do error handling by<br>
returning an error code. However the value returned is ignored (apart<br>
from emitting a warning) and this typically results in resource leaks.<br>
<br>
To improve here there is a quest to make the remove callback return<br>
void. In the first step of this quest all drivers are converted to<br>
.remove_new(), which already returns void. Eventually after all drivers<br>
are converted, .remove_new() will be renamed to .remove().<br>
<br>
Trivially convert this driver from always returning zero in the remove<br>
callback to the void returning variant.<br>
<br>
Signed-off-by: Uwe Kleine-König <<a href="mailto:u.kleine-koenig@pengutronix.de" target="_blank" rel="noreferrer">u.kleine-koenig@pengutronix.de</a>><br>
---<br>
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos7_drm_decon.c    | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_dp.c            | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_drm_drv.c       | 5 ++---<br>
 drivers/gpu/drm/exynos/exynos_drm_fimc.c      | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_drm_fimd.c      | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_drm_g2d.c       | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_drm_gsc.c       | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_drm_mic.c       | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_drm_rotator.c   | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_drm_scaler.c    | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_drm_vidi.c      | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_hdmi.c          | 6 ++----<br>
 drivers/gpu/drm/exynos/exynos_mixer.c         | 6 ++----<br>
 14 files changed, 28 insertions(+), 55 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c<br>
index 4d986077738b..776f2f0b602d 100644<br>
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c<br>
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c<br>
@@ -862,18 +862,16 @@ static int exynos5433_decon_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int exynos5433_decon_remove(struct platform_device *pdev)<br>
+static void exynos5433_decon_remove(struct platform_device *pdev)<br>
 {<br>
        pm_runtime_disable(&pdev->dev);<br>
<br>
        component_del(&pdev->dev, &decon_component_ops);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 struct platform_driver exynos5433_decon_driver = {<br>
        .probe          = exynos5433_decon_probe,<br>
-       .remove         = exynos5433_decon_remove,<br>
+       .remove_new     = exynos5433_decon_remove,<br>
        .driver         = {<br>
                .name   = "exynos5433-decon",<br>
                .pm     = pm_ptr(&exynos5433_decon_pm_ops),<br>
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c<br>
index 0156a5e94435..0d185c0564b9 100644<br>
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c<br>
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c<br>
@@ -765,7 +765,7 @@ static int decon_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int decon_remove(struct platform_device *pdev)<br>
+static void decon_remove(struct platform_device *pdev)<br>
 {<br>
        struct decon_context *ctx = dev_get_drvdata(&pdev->dev);<br>
<br>
@@ -774,8 +774,6 @@ static int decon_remove(struct platform_device *pdev)<br>
        iounmap(ctx->regs);<br>
<br>
        component_del(&pdev->dev, &decon_component_ops);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static int exynos7_decon_suspend(struct device *dev)<br>
@@ -840,7 +838,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(exynos7_decon_pm_ops, exynos7_decon_suspend,<br>
<br>
 struct platform_driver decon_driver = {<br>
        .probe          = decon_probe,<br>
-       .remove         = decon_remove,<br>
+       .remove_new     = decon_remove,<br>
        .driver         = {<br>
                .name   = "exynos-decon",<br>
                .pm     = pm_ptr(&exynos7_decon_pm_ops),<br>
diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c<br>
index 3404ec1367fb..ca31bad6c576 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_dp.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_dp.c<br>
@@ -250,14 +250,12 @@ static int exynos_dp_probe(struct platform_device *pdev)<br>
        return component_add(&pdev->dev, &exynos_dp_ops);<br>
 }<br>
<br>
-static int exynos_dp_remove(struct platform_device *pdev)<br>
+static void exynos_dp_remove(struct platform_device *pdev)<br>
 {<br>
        struct exynos_dp_device *dp = platform_get_drvdata(pdev);<br>
<br>
        component_del(&pdev->dev, &exynos_dp_ops);<br>
        analogix_dp_remove(dp->adp);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static int exynos_dp_suspend(struct device *dev)<br>
@@ -285,7 +283,7 @@ MODULE_DEVICE_TABLE(of, exynos_dp_match);<br>
<br>
 struct platform_driver dp_driver = {<br>
        .probe          = exynos_dp_probe,<br>
-       .remove         = exynos_dp_remove,<br>
+       .remove_new     = exynos_dp_remove,<br>
        .driver         = {<br>
                .name   = "exynos-dp",<br>
                .owner  = THIS_MODULE,<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c<br>
index 8399256cb5c9..a6bff29fc254 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c<br>
@@ -344,15 +344,14 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)<br>
                                               match);<br>
 }<br>
<br>
-static int exynos_drm_platform_remove(struct platform_device *pdev)<br>
+static void exynos_drm_platform_remove(struct platform_device *pdev)<br>
 {<br>
        component_master_del(&pdev->dev, &exynos_drm_ops);<br>
-       return 0;<br>
 }<br>
<br>
 static struct platform_driver exynos_drm_platform_driver = {<br>
        .probe  = exynos_drm_platform_probe,<br>
-       .remove = exynos_drm_platform_remove,<br>
+       .remove_new = exynos_drm_platform_remove,<br>
        .driver = {<br>
                .name   = "exynos-drm",<br>
                .pm     = &exynos_drm_pm_ops,<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c<br>
index 8de2714599fc..e81a576de398 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c<br>
@@ -1367,7 +1367,7 @@ static int fimc_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int fimc_remove(struct platform_device *pdev)<br>
+static void fimc_remove(struct platform_device *pdev)<br>
 {<br>
        struct device *dev = &pdev->dev;<br>
        struct fimc_context *ctx = get_fimc_context(dev);<br>
@@ -1377,8 +1377,6 @@ static int fimc_remove(struct platform_device *pdev)<br>
        pm_runtime_disable(dev);<br>
<br>
        fimc_put_clocks(ctx);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static int fimc_runtime_suspend(struct device *dev)<br>
@@ -1410,7 +1408,7 @@ MODULE_DEVICE_TABLE(of, fimc_of_match);<br>
<br>
 struct platform_driver fimc_driver = {<br>
        .probe          = fimc_probe,<br>
-       .remove         = fimc_remove,<br>
+       .remove_new     = fimc_remove,<br>
        .driver         = {<br>
                .of_match_table = fimc_of_match,<br>
                .name   = "exynos-drm-fimc",<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c<br>
index 8dde7b1e9b35..a9f1c5c05894 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c<br>
@@ -1277,13 +1277,11 @@ static int fimd_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int fimd_remove(struct platform_device *pdev)<br>
+static void fimd_remove(struct platform_device *pdev)<br>
 {<br>
        pm_runtime_disable(&pdev->dev);<br>
<br>
        component_del(&pdev->dev, &fimd_component_ops);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static int exynos_fimd_suspend(struct device *dev)<br>
@@ -1325,7 +1323,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(exynos_fimd_pm_ops, exynos_fimd_suspend,<br>
<br>
 struct platform_driver fimd_driver = {<br>
        .probe          = fimd_probe,<br>
-       .remove         = fimd_remove,<br>
+       .remove_new     = fimd_remove,<br>
        .driver         = {<br>
                .name   = "exynos4-fb",<br>
                .owner  = THIS_MODULE,<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c<br>
index 414e585ec7dd..f3138423612e 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c<br>
@@ -1530,7 +1530,7 @@ static int g2d_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int g2d_remove(struct platform_device *pdev)<br>
+static void g2d_remove(struct platform_device *pdev)<br>
 {<br>
        struct g2d_data *g2d = platform_get_drvdata(pdev);<br>
<br>
@@ -1545,8 +1545,6 @@ static int g2d_remove(struct platform_device *pdev)<br>
        g2d_fini_cmdlist(g2d);<br>
        destroy_workqueue(g2d->g2d_workq);<br>
        kmem_cache_destroy(g2d->runqueue_slab);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static int g2d_suspend(struct device *dev)<br>
@@ -1609,7 +1607,7 @@ MODULE_DEVICE_TABLE(of, exynos_g2d_match);<br>
<br>
 struct platform_driver g2d_driver = {<br>
        .probe          = g2d_probe,<br>
-       .remove         = g2d_remove,<br>
+       .remove_new     = g2d_remove,<br>
        .driver         = {<br>
                .name   = "exynos-drm-g2d",<br>
                .owner  = THIS_MODULE,<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c<br>
index 34cdabc30b4f..6776d3e037c9 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c<br>
@@ -1308,15 +1308,13 @@ static int gsc_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int gsc_remove(struct platform_device *pdev)<br>
+static void gsc_remove(struct platform_device *pdev)<br>
 {<br>
        struct device *dev = &pdev->dev;<br>
<br>
        component_del(dev, &gsc_component_ops);<br>
        pm_runtime_dont_use_autosuspend(dev);<br>
        pm_runtime_disable(dev);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static int __maybe_unused gsc_runtime_suspend(struct device *dev)<br>
@@ -1421,7 +1419,7 @@ MODULE_DEVICE_TABLE(of, exynos_drm_gsc_of_match);<br>
<br>
 struct platform_driver gsc_driver = {<br>
        .probe          = gsc_probe,<br>
-       .remove         = gsc_remove,<br>
+       .remove_new     = gsc_remove,<br>
        .driver         = {<br>
                .name   = "exynos-drm-gsc",<br>
                .owner  = THIS_MODULE,<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c<br>
index 17bab5b1663f..e2920960180f 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c<br>
@@ -442,7 +442,7 @@ static int exynos_mic_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int exynos_mic_remove(struct platform_device *pdev)<br>
+static void exynos_mic_remove(struct platform_device *pdev)<br>
 {<br>
        struct exynos_mic *mic = platform_get_drvdata(pdev);<br>
<br>
@@ -450,8 +450,6 @@ static int exynos_mic_remove(struct platform_device *pdev)<br>
        pm_runtime_disable(&pdev->dev);<br>
<br>
        drm_bridge_remove(&mic->bridge);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static const struct of_device_id exynos_mic_of_match[] = {<br>
@@ -462,7 +460,7 @@ MODULE_DEVICE_TABLE(of, exynos_mic_of_match);<br>
<br>
 struct platform_driver mic_driver = {<br>
        .probe          = exynos_mic_probe,<br>
-       .remove         = exynos_mic_remove,<br>
+       .remove_new     = exynos_mic_remove,<br>
        .driver         = {<br>
                .name   = "exynos-mic",<br>
                .pm     = pm_ptr(&exynos_mic_pm_ops),<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c<br>
index ffb327c5139e..5f7516655b08 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c<br>
@@ -329,15 +329,13 @@ static int rotator_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int rotator_remove(struct platform_device *pdev)<br>
+static void rotator_remove(struct platform_device *pdev)<br>
 {<br>
        struct device *dev = &pdev->dev;<br>
<br>
        component_del(dev, &rotator_component_ops);<br>
        pm_runtime_dont_use_autosuspend(dev);<br>
        pm_runtime_disable(dev);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static int rotator_runtime_suspend(struct device *dev)<br>
@@ -453,7 +451,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(rotator_pm_ops, rotator_runtime_suspend,<br>
<br>
 struct platform_driver rotator_driver = {<br>
        .probe          = rotator_probe,<br>
-       .remove         = rotator_remove,<br>
+       .remove_new     = rotator_remove,<br>
        .driver         = {<br>
                .name   = "exynos-rotator",<br>
                .owner  = THIS_MODULE,<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c<br>
index f2b8b09a6b4e..392f721f13ab 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c<br>
@@ -539,15 +539,13 @@ static int scaler_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int scaler_remove(struct platform_device *pdev)<br>
+static void scaler_remove(struct platform_device *pdev)<br>
 {<br>
        struct device *dev = &pdev->dev;<br>
<br>
        component_del(dev, &scaler_component_ops);<br>
        pm_runtime_dont_use_autosuspend(dev);<br>
        pm_runtime_disable(dev);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static int clk_disable_unprepare_wrapper(struct clk *clk)<br>
@@ -721,7 +719,7 @@ MODULE_DEVICE_TABLE(of, exynos_scaler_match);<br>
<br>
 struct platform_driver scaler_driver = {<br>
        .probe          = scaler_probe,<br>
-       .remove         = scaler_remove,<br>
+       .remove_new     = scaler_remove,<br>
        .driver         = {<br>
                .name   = "exynos-scaler",<br>
                .owner  = THIS_MODULE,<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c<br>
index f5e1adfcaa51..00382f28748a 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c<br>
@@ -462,7 +462,7 @@ static int vidi_probe(struct platform_device *pdev)<br>
        return component_add(dev, &vidi_component_ops);<br>
 }<br>
<br>
-static int vidi_remove(struct platform_device *pdev)<br>
+static void vidi_remove(struct platform_device *pdev)<br>
 {<br>
        struct vidi_context *ctx = platform_get_drvdata(pdev);<br>
<br>
@@ -472,13 +472,11 @@ static int vidi_remove(struct platform_device *pdev)<br>
        }<br>
<br>
        component_del(&pdev->dev, &vidi_component_ops);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 struct platform_driver vidi_driver = {<br>
        .probe          = vidi_probe,<br>
-       .remove         = vidi_remove,<br>
+       .remove_new     = vidi_remove,<br>
        .driver         = {<br>
                .name   = "exynos-drm-vidi",<br>
                .owner  = THIS_MODULE,<br>
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c<br>
index f3aaa4ea3e68..6dfc8411ef84 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c<br>
@@ -2067,7 +2067,7 @@ static int hdmi_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int hdmi_remove(struct platform_device *pdev)<br>
+static void hdmi_remove(struct platform_device *pdev)<br>
 {<br>
        struct hdmi_context *hdata = platform_get_drvdata(pdev);<br>
<br>
@@ -2090,8 +2090,6 @@ static int hdmi_remove(struct platform_device *pdev)<br>
        put_device(&hdata->ddc_adpt->dev);<br>
<br>
        mutex_destroy(&hdata->mutex);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static int __maybe_unused exynos_hdmi_suspend(struct device *dev)<br>
@@ -2123,7 +2121,7 @@ static const struct dev_pm_ops exynos_hdmi_pm_ops = {<br>
<br>
 struct platform_driver hdmi_driver = {<br>
        .probe          = hdmi_probe,<br>
-       .remove         = hdmi_remove,<br>
+       .remove_new     = hdmi_remove,<br>
        .driver         = {<br>
                .name   = "exynos-hdmi",<br>
                .owner  = THIS_MODULE,<br>
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c<br>
index b302392ff0d7..6822333fd0e6 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_mixer.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c<br>
@@ -1258,13 +1258,11 @@ static int mixer_probe(struct platform_device *pdev)<br>
        return ret;<br>
 }<br>
<br>
-static int mixer_remove(struct platform_device *pdev)<br>
+static void mixer_remove(struct platform_device *pdev)<br>
 {<br>
        pm_runtime_disable(&pdev->dev);<br>
<br>
        component_del(&pdev->dev, &mixer_component_ops);<br>
-<br>
-       return 0;<br>
 }<br>
<br>
 static int __maybe_unused exynos_mixer_suspend(struct device *dev)<br>
@@ -1338,5 +1336,5 @@ struct platform_driver mixer_driver = {<br>
                .of_match_table = mixer_match_types,<br>
        },<br>
        .probe = mixer_probe,<br>
-       .remove = mixer_remove,<br>
+       .remove_new = mixer_remove,<br>
 };<br>
-- <br>
2.42.0<br>
<br>
</blockquote></div></div></div>