Unverified Commit 01790d5e authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Javier Martinez Canillas
Browse files

drm/msm: 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 msm 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>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-32-u.kleine-koenig@pengutronix.de
parent c04ca6bb
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -647,10 +647,9 @@ static int adreno_probe(struct platform_device *pdev)
	return 0;
}

static int adreno_remove(struct platform_device *pdev)
static void adreno_remove(struct platform_device *pdev)
{
	component_del(&pdev->dev, &a3xx_ops);
	return 0;
}

static void adreno_shutdown(struct platform_device *pdev)
@@ -765,7 +764,7 @@ static const struct dev_pm_ops adreno_pm_ops = {

static struct platform_driver adreno_driver = {
	.probe = adreno_probe,
	.remove = adreno_remove,
	.remove_new = adreno_remove,
	.shutdown = adreno_shutdown,
	.driver = {
		.name = "adreno",
+2 −4
Original line number Diff line number Diff line
@@ -1239,11 +1239,9 @@ static int dpu_dev_probe(struct platform_device *pdev)
	return msm_drv_probe(&pdev->dev, dpu_kms_init);
}

static int dpu_dev_remove(struct platform_device *pdev)
static void dpu_dev_remove(struct platform_device *pdev)
{
	component_master_del(&pdev->dev, &msm_drm_ops);

	return 0;
}

static int __maybe_unused dpu_runtime_suspend(struct device *dev)
@@ -1318,7 +1316,7 @@ MODULE_DEVICE_TABLE(of, dpu_dt_match);

static struct platform_driver dpu_driver = {
	.probe = dpu_dev_probe,
	.remove = dpu_dev_remove,
	.remove_new = dpu_dev_remove,
	.shutdown = msm_drv_shutdown,
	.driver = {
		.name = "msm_dpu",
+2 −4
Original line number Diff line number Diff line
@@ -561,11 +561,9 @@ static int mdp4_probe(struct platform_device *pdev)
	return msm_drv_probe(&pdev->dev, mdp4_kms_init);
}

static int mdp4_remove(struct platform_device *pdev)
static void mdp4_remove(struct platform_device *pdev)
{
	component_master_del(&pdev->dev, &msm_drm_ops);

	return 0;
}

static const struct of_device_id mdp4_dt_match[] = {
@@ -576,7 +574,7 @@ MODULE_DEVICE_TABLE(of, mdp4_dt_match);

static struct platform_driver mdp4_platform_driver = {
	.probe      = mdp4_probe,
	.remove     = mdp4_remove,
	.remove_new = mdp4_remove,
	.shutdown   = msm_drv_shutdown,
	.driver     = {
		.name   = "mdp4",
+2 −3
Original line number Diff line number Diff line
@@ -942,11 +942,10 @@ static int mdp5_dev_probe(struct platform_device *pdev)
	return msm_drv_probe(&pdev->dev, mdp5_kms_init);
}

static int mdp5_dev_remove(struct platform_device *pdev)
static void mdp5_dev_remove(struct platform_device *pdev)
{
	DBG("");
	component_master_del(&pdev->dev, &msm_drm_ops);
	return 0;
}

static __maybe_unused int mdp5_runtime_suspend(struct device *dev)
@@ -987,7 +986,7 @@ MODULE_DEVICE_TABLE(of, mdp5_dt_match);

static struct platform_driver mdp5_driver = {
	.probe = mdp5_dev_probe,
	.remove = mdp5_dev_remove,
	.remove_new = mdp5_dev_remove,
	.shutdown = msm_drv_shutdown,
	.driver = {
		.name = "msm_mdp",
+2 −4
Original line number Diff line number Diff line
@@ -1296,7 +1296,7 @@ static int dp_display_probe(struct platform_device *pdev)
	return rc;
}

static int dp_display_remove(struct platform_device *pdev)
static void dp_display_remove(struct platform_device *pdev)
{
	struct dp_display_private *dp = dev_get_dp_display_private(&pdev->dev);

@@ -1304,8 +1304,6 @@ static int dp_display_remove(struct platform_device *pdev)
	dp_display_deinit_sub_modules(dp);

	platform_set_drvdata(pdev, NULL);

	return 0;
}

static int dp_pm_resume(struct device *dev)
@@ -1415,7 +1413,7 @@ static const struct dev_pm_ops dp_pm_ops = {

static struct platform_driver dp_display_driver = {
	.probe  = dp_display_probe,
	.remove = dp_display_remove,
	.remove_new = dp_display_remove,
	.driver = {
		.name = "msm-dp-display",
		.of_match_table = dp_dt_match,
Loading