]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/sun4i: Convert to platform remove callback returning void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sun, 7 May 2023 16:26:06 +0000 (18:26 +0200)
committerDouglas Anderson <dianders@chromium.org>
Thu, 8 Jun 2023 16:04:12 +0000 (09:04 -0700)
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 sun4i 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>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-44-u.kleine-koenig@pengutronix.de
drivers/gpu/drm/sun4i/sun4i_backend.c
drivers/gpu/drm/sun4i/sun4i_drv.c
drivers/gpu/drm/sun4i/sun4i_frontend.c
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
drivers/gpu/drm/sun4i/sun4i_tcon.c
drivers/gpu/drm/sun4i/sun4i_tv.c
drivers/gpu/drm/sun4i/sun6i_drc.c
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
drivers/gpu/drm/sun4i/sun8i_mixer.c
drivers/gpu/drm/sun4i/sun8i_tcon_top.c

index b11dbd50d73e98fbcc3434dfbec08fea9d7531c2..335fd0edb904cfc536a1871ade229109c15ebbf9 100644 (file)
@@ -965,11 +965,9 @@ static int sun4i_backend_probe(struct platform_device *pdev)
        return component_add(&pdev->dev, &sun4i_backend_ops);
 }
 
-static int sun4i_backend_remove(struct platform_device *pdev)
+static void sun4i_backend_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &sun4i_backend_ops);
-
-       return 0;
 }
 
 static const struct sun4i_backend_quirks sun4i_backend_quirks = {
@@ -1028,7 +1026,7 @@ MODULE_DEVICE_TABLE(of, sun4i_backend_of_table);
 
 static struct platform_driver sun4i_backend_platform_driver = {
        .probe          = sun4i_backend_probe,
-       .remove         = sun4i_backend_remove,
+       .remove_new     = sun4i_backend_remove,
        .driver         = {
                .name           = "sun4i-backend",
                .of_match_table = sun4i_backend_of_table,
index daa7faf72a4b785876d11928f1e54b44d2f7580d..6a8dfc022d3c1cc21e1ac48fba28a96eacb70a87 100644 (file)
@@ -408,11 +408,9 @@ static int sun4i_drv_probe(struct platform_device *pdev)
                return 0;
 }
 
-static int sun4i_drv_remove(struct platform_device *pdev)
+static void sun4i_drv_remove(struct platform_device *pdev)
 {
        component_master_del(&pdev->dev, &sun4i_drv_master_ops);
-
-       return 0;
 }
 
 static const struct of_device_id sun4i_drv_of_table[] = {
@@ -438,7 +436,7 @@ MODULE_DEVICE_TABLE(of, sun4i_drv_of_table);
 
 static struct platform_driver sun4i_drv_platform_driver = {
        .probe          = sun4i_drv_probe,
-       .remove         = sun4i_drv_remove,
+       .remove_new     = sun4i_drv_remove,
        .driver         = {
                .name           = "sun4i-drm",
                .of_match_table = sun4i_drv_of_table,
index 799ab7460ae5427901bc7e018f2d61c95aac8be4..3872c91a85c70c9e45073ea97ea743e23c209eb4 100644 (file)
@@ -634,11 +634,9 @@ static int sun4i_frontend_probe(struct platform_device *pdev)
        return component_add(&pdev->dev, &sun4i_frontend_ops);
 }
 
-static int sun4i_frontend_remove(struct platform_device *pdev)
+static void sun4i_frontend_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &sun4i_frontend_ops);
-
-       return 0;
 }
 
 static int sun4i_frontend_runtime_resume(struct device *dev)
@@ -719,7 +717,7 @@ MODULE_DEVICE_TABLE(of, sun4i_frontend_of_table);
 
 static struct platform_driver sun4i_frontend_driver = {
        .probe          = sun4i_frontend_probe,
-       .remove         = sun4i_frontend_remove,
+       .remove_new     = sun4i_frontend_remove,
        .driver         = {
                .name           = "sun4i-frontend",
                .of_match_table = sun4i_frontend_of_table,
index c0df5e892fa7e0b251d892fc8a0b974448b3ae96..c139e1262e032aa05769687f30104a6fdef69afc 100644 (file)
@@ -693,11 +693,9 @@ static int sun4i_hdmi_probe(struct platform_device *pdev)
        return component_add(&pdev->dev, &sun4i_hdmi_ops);
 }
 
-static int sun4i_hdmi_remove(struct platform_device *pdev)
+static void sun4i_hdmi_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &sun4i_hdmi_ops);
-
-       return 0;
 }
 
 static const struct of_device_id sun4i_hdmi_of_table[] = {
@@ -710,7 +708,7 @@ MODULE_DEVICE_TABLE(of, sun4i_hdmi_of_table);
 
 static struct platform_driver sun4i_hdmi_driver = {
        .probe          = sun4i_hdmi_probe,
-       .remove         = sun4i_hdmi_remove,
+       .remove_new     = sun4i_hdmi_remove,
        .driver         = {
                .name           = "sun4i-hdmi",
                .of_match_table = sun4i_hdmi_of_table,
index 6a52fb12cbfbc903b1d71d472a40c8e1f2a412c0..b07ccee78cc104c2853f775475e4b0b76629daa9 100644 (file)
@@ -1331,11 +1331,9 @@ static int sun4i_tcon_probe(struct platform_device *pdev)
        return component_add(&pdev->dev, &sun4i_tcon_ops);
 }
 
-static int sun4i_tcon_remove(struct platform_device *pdev)
+static void sun4i_tcon_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &sun4i_tcon_ops);
-
-       return 0;
 }
 
 /* platform specific TCON muxing callbacks */
@@ -1570,7 +1568,7 @@ EXPORT_SYMBOL(sun4i_tcon_of_table);
 
 static struct platform_driver sun4i_tcon_platform_driver = {
        .probe          = sun4i_tcon_probe,
-       .remove         = sun4i_tcon_remove,
+       .remove_new     = sun4i_tcon_remove,
        .driver         = {
                .name           = "sun4i-tcon",
                .of_match_table = sun4i_tcon_of_table,
index 9625a00a48ba145da2ecb43070833d9b45437b6c..ec65d9d59de7dc1a44e039743f95362c423070f3 100644 (file)
@@ -546,11 +546,9 @@ static int sun4i_tv_probe(struct platform_device *pdev)
        return component_add(&pdev->dev, &sun4i_tv_ops);
 }
 
-static int sun4i_tv_remove(struct platform_device *pdev)
+static void sun4i_tv_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &sun4i_tv_ops);
-
-       return 0;
 }
 
 static const struct of_device_id sun4i_tv_of_table[] = {
@@ -561,7 +559,7 @@ MODULE_DEVICE_TABLE(of, sun4i_tv_of_table);
 
 static struct platform_driver sun4i_tv_platform_driver = {
        .probe          = sun4i_tv_probe,
-       .remove         = sun4i_tv_remove,
+       .remove_new     = sun4i_tv_remove,
        .driver         = {
                .name           = "sun4i-tve",
                .of_match_table = sun4i_tv_of_table,
index 4fbe9a6b5182c48c9c0f0870706ca801df5d34c1..0d342f43fa93e460eb4fac628eb1e50c9140eac7 100644 (file)
@@ -95,11 +95,9 @@ static int sun6i_drc_probe(struct platform_device *pdev)
        return component_add(&pdev->dev, &sun6i_drc_ops);
 }
 
-static int sun6i_drc_remove(struct platform_device *pdev)
+static void sun6i_drc_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &sun6i_drc_ops);
-
-       return 0;
 }
 
 static const struct of_device_id sun6i_drc_of_table[] = {
@@ -114,7 +112,7 @@ MODULE_DEVICE_TABLE(of, sun6i_drc_of_table);
 
 static struct platform_driver sun6i_drc_platform_driver = {
        .probe          = sun6i_drc_probe,
-       .remove         = sun6i_drc_remove,
+       .remove_new     = sun6i_drc_remove,
        .driver         = {
                .name           = "sun6i-drc",
                .of_match_table = sun6i_drc_of_table,
index 760ff05eabf4076ec522dc17ab7a2632f4d141c8..4abf4f1020074e0d259a6a31d2f3d2c40a101130 100644 (file)
@@ -1200,7 +1200,7 @@ err_attach_clk:
        return ret;
 }
 
-static int sun6i_dsi_remove(struct platform_device *pdev)
+static void sun6i_dsi_remove(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct sun6i_dsi *dsi = dev_get_drvdata(dev);
@@ -1211,8 +1211,6 @@ static int sun6i_dsi_remove(struct platform_device *pdev)
                clk_rate_exclusive_put(dsi->mod_clk);
 
        regmap_mmio_detach_clk(dsi->regs);
-
-       return 0;
 }
 
 static const struct sun6i_dsi_variant sun6i_a31_mipi_dsi_variant = {
@@ -1246,7 +1244,7 @@ MODULE_DEVICE_TABLE(of, sun6i_dsi_of_table);
 
 static struct platform_driver sun6i_dsi_platform_driver = {
        .probe          = sun6i_dsi_probe,
-       .remove         = sun6i_dsi_remove,
+       .remove_new     = sun6i_dsi_remove,
        .driver         = {
                .name           = "sun6i-mipi-dsi",
                .of_match_table = sun6i_dsi_of_table,
index 7cab4213a6808ba09c0d80711507f1dc0c3d21d5..26dd8f0dde99b1d9ef81b2e83f657bbab865f1da 100644 (file)
@@ -235,11 +235,9 @@ static int sun8i_dw_hdmi_probe(struct platform_device *pdev)
        return component_add(&pdev->dev, &sun8i_dw_hdmi_ops);
 }
 
-static int sun8i_dw_hdmi_remove(struct platform_device *pdev)
+static void sun8i_dw_hdmi_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &sun8i_dw_hdmi_ops);
-
-       return 0;
 }
 
 static const struct sun8i_dw_hdmi_quirks sun8i_a83t_quirks = {
@@ -266,7 +264,7 @@ MODULE_DEVICE_TABLE(of, sun8i_dw_hdmi_dt_ids);
 
 static struct platform_driver sun8i_dw_hdmi_pltfm_driver = {
        .probe  = sun8i_dw_hdmi_probe,
-       .remove = sun8i_dw_hdmi_remove,
+       .remove_new = sun8i_dw_hdmi_remove,
        .driver = {
                .name = "sun8i-dw-hdmi",
                .of_match_table = sun8i_dw_hdmi_dt_ids,
index 11d5244a5aa5fc656f8e2ad8fda6419f7d1559c1..07a6381064143ab6f7f3dc31fd0fb2f7fc56c1b5 100644 (file)
@@ -555,11 +555,9 @@ static int sun8i_mixer_probe(struct platform_device *pdev)
        return component_add(&pdev->dev, &sun8i_mixer_ops);
 }
 
-static int sun8i_mixer_remove(struct platform_device *pdev)
+static void sun8i_mixer_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &sun8i_mixer_ops);
-
-       return 0;
 }
 
 static const struct sun8i_mixer_cfg sun8i_a83t_mixer0_cfg = {
@@ -711,7 +709,7 @@ MODULE_DEVICE_TABLE(of, sun8i_mixer_of_table);
 
 static struct platform_driver sun8i_mixer_platform_driver = {
        .probe          = sun8i_mixer_probe,
-       .remove         = sun8i_mixer_remove,
+       .remove_new     = sun8i_mixer_remove,
        .driver         = {
                .name           = "sun8i-mixer",
                .of_match_table = sun8i_mixer_of_table,
index da97682b68351431a6f5df53403d10a87228114b..2e8dd7723e297b2670e7d3021bd6eb7a6b2a13a3 100644 (file)
@@ -261,11 +261,9 @@ static int sun8i_tcon_top_probe(struct platform_device *pdev)
        return component_add(&pdev->dev, &sun8i_tcon_top_ops);
 }
 
-static int sun8i_tcon_top_remove(struct platform_device *pdev)
+static void sun8i_tcon_top_remove(struct platform_device *pdev)
 {
        component_del(&pdev->dev, &sun8i_tcon_top_ops);
-
-       return 0;
 }
 
 static const struct sun8i_tcon_top_quirks sun8i_r40_tcon_top_quirks = {
@@ -302,7 +300,7 @@ EXPORT_SYMBOL(sun8i_tcon_top_of_table);
 
 static struct platform_driver sun8i_tcon_top_platform_driver = {
        .probe          = sun8i_tcon_top_probe,
-       .remove         = sun8i_tcon_top_remove,
+       .remove_new     = sun8i_tcon_top_remove,
        .driver         = {
                .name           = "sun8i-tcon-top",
                .of_match_table = sun8i_tcon_top_of_table,