soc/tegra: cbb: tegra194-cbb: 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 this driver 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: Thierry Reding <treding@nvidia.com>
This commit is contained in:
Uwe Kleine-König 2023-09-25 11:55:23 +02:00 committed by Thierry Reding
parent 0bb80ecc33
commit d3f785d74b

View File

@ -2293,7 +2293,7 @@ static int tegra194_cbb_probe(struct platform_device *pdev)
return tegra_cbb_register(&cbb->base); return tegra_cbb_register(&cbb->base);
} }
static int tegra194_cbb_remove(struct platform_device *pdev) static void tegra194_cbb_remove(struct platform_device *pdev)
{ {
struct tegra194_cbb *cbb = platform_get_drvdata(pdev); struct tegra194_cbb *cbb = platform_get_drvdata(pdev);
struct tegra_cbb *noc, *tmp; struct tegra_cbb *noc, *tmp;
@ -2311,8 +2311,6 @@ static int tegra194_cbb_remove(struct platform_device *pdev)
} }
spin_unlock_irqrestore(&cbb_lock, flags); spin_unlock_irqrestore(&cbb_lock, flags);
return 0;
} }
static int __maybe_unused tegra194_cbb_resume_noirq(struct device *dev) static int __maybe_unused tegra194_cbb_resume_noirq(struct device *dev)
@ -2332,7 +2330,7 @@ static const struct dev_pm_ops tegra194_cbb_pm = {
static struct platform_driver tegra194_cbb_driver = { static struct platform_driver tegra194_cbb_driver = {
.probe = tegra194_cbb_probe, .probe = tegra194_cbb_probe,
.remove = tegra194_cbb_remove, .remove_new = tegra194_cbb_remove,
.driver = { .driver = {
.name = "tegra194-cbb", .name = "tegra194-cbb",
.of_match_table = of_match_ptr(tegra194_cbb_match), .of_match_table = of_match_ptr(tegra194_cbb_match),