Commit 0c259ab1 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Douglas Anderson

drm/stm: 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 stm drm drivers from always returning zero in the
remove callback to the void returning variant.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: default avatarRaphaël Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-43-u.kleine-koenig@pengutronix.de
parent 9a865e45
...@@ -213,7 +213,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev) ...@@ -213,7 +213,7 @@ static int stm_drm_platform_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int stm_drm_platform_remove(struct platform_device *pdev) static void stm_drm_platform_remove(struct platform_device *pdev)
{ {
struct drm_device *ddev = platform_get_drvdata(pdev); struct drm_device *ddev = platform_get_drvdata(pdev);
...@@ -222,8 +222,6 @@ static int stm_drm_platform_remove(struct platform_device *pdev) ...@@ -222,8 +222,6 @@ static int stm_drm_platform_remove(struct platform_device *pdev)
drm_dev_unregister(ddev); drm_dev_unregister(ddev);
drv_unload(ddev); drv_unload(ddev);
drm_dev_put(ddev); drm_dev_put(ddev);
return 0;
} }
static const struct of_device_id drv_dt_ids[] = { static const struct of_device_id drv_dt_ids[] = {
...@@ -234,7 +232,7 @@ MODULE_DEVICE_TABLE(of, drv_dt_ids); ...@@ -234,7 +232,7 @@ MODULE_DEVICE_TABLE(of, drv_dt_ids);
static struct platform_driver stm_drm_platform_driver = { static struct platform_driver stm_drm_platform_driver = {
.probe = stm_drm_platform_probe, .probe = stm_drm_platform_probe,
.remove = stm_drm_platform_remove, .remove_new = stm_drm_platform_remove,
.driver = { .driver = {
.name = "stm32-display", .name = "stm32-display",
.of_match_table = drv_dt_ids, .of_match_table = drv_dt_ids,
......
...@@ -535,15 +535,13 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev) ...@@ -535,15 +535,13 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int dw_mipi_dsi_stm_remove(struct platform_device *pdev) static void dw_mipi_dsi_stm_remove(struct platform_device *pdev)
{ {
struct dw_mipi_dsi_stm *dsi = platform_get_drvdata(pdev); struct dw_mipi_dsi_stm *dsi = platform_get_drvdata(pdev);
dw_mipi_dsi_remove(dsi->dsi); dw_mipi_dsi_remove(dsi->dsi);
clk_disable_unprepare(dsi->pllref_clk); clk_disable_unprepare(dsi->pllref_clk);
regulator_disable(dsi->vdd_supply); regulator_disable(dsi->vdd_supply);
return 0;
} }
static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev) static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev)
...@@ -588,7 +586,7 @@ static const struct dev_pm_ops dw_mipi_dsi_stm_pm_ops = { ...@@ -588,7 +586,7 @@ static const struct dev_pm_ops dw_mipi_dsi_stm_pm_ops = {
static struct platform_driver dw_mipi_dsi_stm_driver = { static struct platform_driver dw_mipi_dsi_stm_driver = {
.probe = dw_mipi_dsi_stm_probe, .probe = dw_mipi_dsi_stm_probe,
.remove = dw_mipi_dsi_stm_remove, .remove_new = dw_mipi_dsi_stm_remove,
.driver = { .driver = {
.of_match_table = dw_mipi_dsi_stm_dt_ids, .of_match_table = dw_mipi_dsi_stm_dt_ids,
.name = "stm32-display-dsi", .name = "stm32-display-dsi",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment