media: staging: media: tegra-video: 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert the three tegra-video 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>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Uwe Kleine-König 2023-10-26 23:47:40 +02:00 committed by Mauro Carvalho Chehab
parent ded85b0c0e
commit 074728523d
3 changed files with 6 additions and 12 deletions

View File

@ -818,15 +818,13 @@ static int tegra_csi_probe(struct platform_device *pdev)
return ret;
}
static int tegra_csi_remove(struct platform_device *pdev)
static void tegra_csi_remove(struct platform_device *pdev)
{
struct tegra_csi *csi = platform_get_drvdata(pdev);
host1x_client_unregister(&csi->client);
pm_runtime_disable(&pdev->dev);
return 0;
}
#if defined(CONFIG_ARCH_TEGRA_210_SOC)
@ -852,5 +850,5 @@ struct platform_driver tegra_csi_driver = {
.pm = &tegra_csi_pm_ops,
},
.probe = tegra_csi_probe,
.remove = tegra_csi_remove,
.remove_new = tegra_csi_remove,
};

View File

@ -1944,7 +1944,7 @@ static int tegra_vi_probe(struct platform_device *pdev)
return ret;
}
static int tegra_vi_remove(struct platform_device *pdev)
static void tegra_vi_remove(struct platform_device *pdev)
{
struct tegra_vi *vi = platform_get_drvdata(pdev);
@ -1953,8 +1953,6 @@ static int tegra_vi_remove(struct platform_device *pdev)
if (vi->ops->vi_enable)
vi->ops->vi_enable(vi, false);
pm_runtime_disable(&pdev->dev);
return 0;
}
static const struct of_device_id tegra_vi_of_id_table[] = {
@ -1979,5 +1977,5 @@ struct platform_driver tegra_vi_driver = {
.pm = &tegra_vi_pm_ops,
},
.probe = tegra_vi_probe,
.remove = tegra_vi_remove,
.remove_new = tegra_vi_remove,
};

View File

@ -254,15 +254,13 @@ static int tegra_vip_probe(struct platform_device *pdev)
return 0;
}
static int tegra_vip_remove(struct platform_device *pdev)
static void tegra_vip_remove(struct platform_device *pdev)
{
struct tegra_vip *vip = platform_get_drvdata(pdev);
host1x_client_unregister(&vip->client);
pm_runtime_disable(&pdev->dev);
return 0;
}
#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
@ -283,5 +281,5 @@ struct platform_driver tegra_vip_driver = {
.of_match_table = tegra_vip_of_id_table,
},
.probe = tegra_vip_probe,
.remove = tegra_vip_remove,
.remove_new = tegra_vip_remove,
};