Commit 17e1b2db authored by Uwe Kleine-König's avatar Uwe Kleine-König

gpu: host1x: 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.
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/7e31909b1e536f0ddbb060b1aaa0a9e943687c8a.1712681770.git.u.kleine-koenig@pengutronix.deSigned-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 573a39d0
...@@ -677,7 +677,7 @@ static int host1x_probe(struct platform_device *pdev) ...@@ -677,7 +677,7 @@ static int host1x_probe(struct platform_device *pdev)
return err; return err;
} }
static int host1x_remove(struct platform_device *pdev) static void host1x_remove(struct platform_device *pdev)
{ {
struct host1x *host = platform_get_drvdata(pdev); struct host1x *host = platform_get_drvdata(pdev);
...@@ -692,8 +692,6 @@ static int host1x_remove(struct platform_device *pdev) ...@@ -692,8 +692,6 @@ static int host1x_remove(struct platform_device *pdev)
host1x_channel_list_free(&host->channel_list); host1x_channel_list_free(&host->channel_list);
host1x_iommu_exit(host); host1x_iommu_exit(host);
host1x_bo_cache_destroy(&host->cache); host1x_bo_cache_destroy(&host->cache);
return 0;
} }
static int __maybe_unused host1x_runtime_suspend(struct device *dev) static int __maybe_unused host1x_runtime_suspend(struct device *dev)
...@@ -778,7 +776,7 @@ static struct platform_driver tegra_host1x_driver = { ...@@ -778,7 +776,7 @@ static struct platform_driver tegra_host1x_driver = {
.pm = &host1x_pm_ops, .pm = &host1x_pm_ops,
}, },
.probe = host1x_probe, .probe = host1x_probe,
.remove = host1x_remove, .remove_new = host1x_remove,
}; };
static struct platform_driver * const drivers[] = { static struct platform_driver * const drivers[] = {
......
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