diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-05-07 19:26:04 +0300 |
---|---|---|
committer | Douglas Anderson <dianders@chromium.org> | 2023-06-08 19:04:12 +0300 |
commit | 9a865e45884aad3f715f7b45ccbc0537f92cbcd8 (patch) | |
tree | 6fac46b83921406449db6091db14926d35bdeab4 /drivers/gpu/drm | |
parent | 3c855610840ebe3505f0db88b51191ced0b0af1f (diff) | |
download | linux-9a865e45884aad3f715f7b45ccbc0537f92cbcd8.tar.xz |
drm/sti: 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 sti 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>
Acked-by: Alain Volmat <alain.volmat@foss.st.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-42-u.kleine-koenig@pengutronix.de
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/sti/sti_compositor.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_drv.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_dvo.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_hda.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_hdmi.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_hqvdp.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/sti/sti_tvout.c | 5 |
7 files changed, 14 insertions, 23 deletions
diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c index 142a8e1b4436..33487a1fed8f 100644 --- a/drivers/gpu/drm/sti/sti_compositor.c +++ b/drivers/gpu/drm/sti/sti_compositor.c @@ -258,10 +258,9 @@ static int sti_compositor_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sti_compositor_ops); } -static int sti_compositor_remove(struct platform_device *pdev) +static void sti_compositor_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sti_compositor_ops); - return 0; } struct platform_driver sti_compositor_driver = { @@ -270,7 +269,7 @@ struct platform_driver sti_compositor_driver = { .of_match_table = compositor_of_match, }, .probe = sti_compositor_probe, - .remove = sti_compositor_remove, + .remove_new = sti_compositor_remove, }; MODULE_AUTHOR("Benjamin Gaignard <benjamin.gaignard@st.com>"); diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index 1b87b5899f9e..346c151e87be 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -246,11 +246,9 @@ static int sti_platform_probe(struct platform_device *pdev) return component_master_add_with_match(dev, &sti_ops, match); } -static int sti_platform_remove(struct platform_device *pdev) +static void sti_platform_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &sti_ops); - - return 0; } static const struct of_device_id sti_dt_ids[] = { @@ -261,7 +259,7 @@ MODULE_DEVICE_TABLE(of, sti_dt_ids); static struct platform_driver sti_platform_driver = { .probe = sti_platform_probe, - .remove = sti_platform_remove, + .remove_new = sti_platform_remove, .driver = { .name = DRIVER_NAME, .of_match_table = sti_dt_ids, diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index 0c6679e361c8..fd1df4ce3852 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -567,10 +567,9 @@ static int sti_dvo_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sti_dvo_ops); } -static int sti_dvo_remove(struct platform_device *pdev) +static void sti_dvo_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sti_dvo_ops); - return 0; } static const struct of_device_id dvo_of_match[] = { @@ -586,7 +585,7 @@ struct platform_driver sti_dvo_driver = { .of_match_table = dvo_of_match, }, .probe = sti_dvo_probe, - .remove = sti_dvo_remove, + .remove_new = sti_dvo_remove, }; MODULE_AUTHOR("Benjamin Gaignard <benjamin.gaignard@st.com>"); diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index 15097ac67931..6ee35612a14e 100644 --- a/drivers/gpu/drm/sti/sti_hda.c +++ b/drivers/gpu/drm/sti/sti_hda.c @@ -792,10 +792,9 @@ static int sti_hda_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sti_hda_ops); } -static int sti_hda_remove(struct platform_device *pdev) +static void sti_hda_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sti_hda_ops); - return 0; } static const struct of_device_id hda_of_match[] = { @@ -812,7 +811,7 @@ struct platform_driver sti_hda_driver = { .of_match_table = hda_of_match, }, .probe = sti_hda_probe, - .remove = sti_hda_remove, + .remove_new = sti_hda_remove, }; MODULE_AUTHOR("Benjamin Gaignard <benjamin.gaignard@st.com>"); diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index dc1562f14ceb..500936d5743c 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -1472,7 +1472,7 @@ static int sti_hdmi_probe(struct platform_device *pdev) return ret; } -static int sti_hdmi_remove(struct platform_device *pdev) +static void sti_hdmi_remove(struct platform_device *pdev) { struct sti_hdmi *hdmi = dev_get_drvdata(&pdev->dev); @@ -1480,8 +1480,6 @@ static int sti_hdmi_remove(struct platform_device *pdev) if (hdmi->audio_pdev) platform_device_unregister(hdmi->audio_pdev); component_del(&pdev->dev, &sti_hdmi_ops); - - return 0; } struct platform_driver sti_hdmi_driver = { @@ -1491,7 +1489,7 @@ struct platform_driver sti_hdmi_driver = { .of_match_table = hdmi_of_match, }, .probe = sti_hdmi_probe, - .remove = sti_hdmi_remove, + .remove_new = sti_hdmi_remove, }; MODULE_AUTHOR("Benjamin Gaignard <benjamin.gaignard@st.com>"); diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 02b77279f6e4..0fb48ac044d8 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1400,10 +1400,9 @@ static int sti_hqvdp_probe(struct platform_device *pdev) return component_add(&pdev->dev, &sti_hqvdp_ops); } -static int sti_hqvdp_remove(struct platform_device *pdev) +static void sti_hqvdp_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sti_hqvdp_ops); - return 0; } static const struct of_device_id hqvdp_of_match[] = { @@ -1419,7 +1418,7 @@ struct platform_driver sti_hqvdp_driver = { .of_match_table = hqvdp_of_match, }, .probe = sti_hqvdp_probe, - .remove = sti_hqvdp_remove, + .remove_new = sti_hqvdp_remove, }; MODULE_AUTHOR("Benjamin Gaignard <benjamin.gaignard@st.com>"); diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index 2499715a69b7..64615638b79a 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c @@ -872,10 +872,9 @@ static int sti_tvout_probe(struct platform_device *pdev) return component_add(dev, &sti_tvout_ops); } -static int sti_tvout_remove(struct platform_device *pdev) +static void sti_tvout_remove(struct platform_device *pdev) { component_del(&pdev->dev, &sti_tvout_ops); - return 0; } static const struct of_device_id tvout_of_match[] = { @@ -891,7 +890,7 @@ struct platform_driver sti_tvout_driver = { .of_match_table = tvout_of_match, }, .probe = sti_tvout_probe, - .remove = sti_tvout_remove, + .remove_new = sti_tvout_remove, }; MODULE_AUTHOR("Benjamin Gaignard <benjamin.gaignard@st.com>"); |