UPSTREAM: gpu: host1x: Make host1x_client_unregister() return void

This function returned zero unconditionally. Make it return no value and
simplify all callers accordingly.

Bug 4303860

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Change-Id: I07bf696e8af7c3472355b52549fb43ff3987c108
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2986788
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Uwe Kleine-König
2023-03-22 18:02:12 +01:00
committed by mobile promotions
parent 4df331c666
commit ee866593b7
15 changed files with 17 additions and 91 deletions

View File

@@ -3267,12 +3267,7 @@ static int tegra_dc_remove(struct platform_device *pdev)
struct tegra_dc *dc = platform_get_drvdata(pdev);
int err;
err = host1x_client_unregister(&dc->client);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&dc->client);
err = tegra_dc_rgb_remove(dc);
if (err < 0) {

View File

@@ -1662,16 +1662,10 @@ mipi_free:
static int tegra_dsi_remove(struct platform_device *pdev)
{
struct tegra_dsi *dsi = platform_get_drvdata(pdev);
int err;
pm_runtime_disable(&pdev->dev);
err = host1x_client_unregister(&dsi->client);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&dsi->client);
tegra_output_remove(&dsi->output);

View File

@@ -294,16 +294,10 @@ static int gr2d_probe(struct platform_device *pdev)
static int gr2d_remove(struct platform_device *pdev)
{
struct gr2d *gr2d = platform_get_drvdata(pdev);
int err;
pm_runtime_disable(&pdev->dev);
err = host1x_client_unregister(&gr2d->client.base);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&gr2d->client.base);
return 0;
}

View File

@@ -553,16 +553,10 @@ static int gr3d_probe(struct platform_device *pdev)
static int gr3d_remove(struct platform_device *pdev)
{
struct gr3d *gr3d = platform_get_drvdata(pdev);
int err;
pm_runtime_disable(&pdev->dev);
err = host1x_client_unregister(&gr3d->client.base);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&gr3d->client.base);
return 0;
}

View File

@@ -1893,18 +1893,12 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
static int tegra_hdmi_remove(struct platform_device *pdev)
{
struct tegra_hdmi *hdmi = platform_get_drvdata(pdev);
int err;
#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
pm_runtime_disable(&pdev->dev);
#endif
err = host1x_client_unregister(&hdmi->client);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&hdmi->client);
tegra_output_remove(&hdmi->output);

View File

@@ -1178,13 +1178,8 @@ static int tegra_display_hub_remove(struct platform_device *pdev)
{
struct tegra_display_hub *hub = platform_get_drvdata(pdev);
unsigned int i;
int err;
err = host1x_client_unregister(&hub->client);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
}
host1x_client_unregister(&hub->client);
for (i = 0; i < hub->soc->num_wgrps; i++) {
struct tegra_windowgroup *wgrp = &hub->wgrps[i];
@@ -1194,7 +1189,7 @@ static int tegra_display_hub_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
return err;
return 0;
}
static const struct tegra_display_hub_soc tegra186_display_hub = {

View File

@@ -870,12 +870,7 @@ static int nvdec_remove(struct platform_device *pdev)
dev_info(&pdev->dev, "failed to unregister host1x actmon: %d\n",
err);
err = host1x_client_unregister(&nvdec->client.base);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&nvdec->client.base);
falcon_exit(&nvdec->falcon);

View File

@@ -736,12 +736,7 @@ static int nvenc_remove(struct platform_device *pdev)
dev_info(&pdev->dev, "failed to unregister host1x actmon: %d\n",
err);
err = host1x_client_unregister(&nvenc->client.base);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&nvenc->client.base);
falcon_exit(&nvenc->falcon);

View File

@@ -723,12 +723,7 @@ static int nvjpg_remove(struct platform_device *pdev)
dev_info(&pdev->dev, "failed to unregister host1x actmon: %d\n",
err);
err = host1x_client_unregister(&nvjpg->client.base);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&nvjpg->client.base);
falcon_exit(&nvjpg->falcon);

View File

@@ -383,16 +383,10 @@ exit_falcon:
static int ofa_remove(struct platform_device *pdev)
{
struct ofa *ofa = platform_get_drvdata(pdev);
int err;
pm_runtime_disable(&pdev->dev);
err = host1x_client_unregister(&ofa->client.base);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&ofa->client.base);
falcon_exit(&ofa->falcon);

View File

@@ -3993,14 +3993,8 @@ put_aux:
static int tegra_sor_remove(struct platform_device *pdev)
{
struct tegra_sor *sor = platform_get_drvdata(pdev);
int err;
err = host1x_client_unregister(&sor->client);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&sor->client);
pm_runtime_disable(&pdev->dev);

View File

@@ -804,12 +804,7 @@ static int vic_remove(struct platform_device *pdev)
dev_info(&pdev->dev, "failed to unregister host1x actmon: %d\n",
err);
err = host1x_client_unregister(&vic->client.base);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&vic->client.base);
falcon_exit(&vic->falcon);

View File

@@ -527,7 +527,6 @@ unregister_client:
static int virt_engine_remove(struct platform_device *pdev)
{
struct virt_engine *virt_engine = platform_get_drvdata(pdev);
int err;
#ifndef CONFIG_TEGRA_SYSTEM_TYPE_ACK
struct tegra_soc_hwpm_ip_ops hwpm_ip_ops;
u32 hwpm_ip_index = virt_engine_get_ip_index(pdev->name);
@@ -547,12 +546,7 @@ static int virt_engine_remove(struct platform_device *pdev)
virt_engine_cleanup_actmon_debugfs(virt_engine);
virt_engine_cleanup();
err = host1x_client_unregister(&virt_engine->client.base);
if (err < 0) {
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",
err);
return err;
}
host1x_client_unregister(&virt_engine->client.base);
return 0;
}

View File

@@ -808,7 +808,7 @@ EXPORT_SYMBOL(__host1x_client_register);
* Removes a host1x client from its host1x controller instance. If a logical
* device has already been initialized, it will be torn down.
*/
int host1x_client_unregister(struct host1x_client *client)
void host1x_client_unregister(struct host1x_client *client)
{
struct host1x_client *c;
struct host1x *host1x;
@@ -820,7 +820,7 @@ int host1x_client_unregister(struct host1x_client *client)
err = host1x_del_client(host1x, client);
if (!err) {
mutex_unlock(&devices_lock);
return 0;
return;
}
}
@@ -837,8 +837,6 @@ int host1x_client_unregister(struct host1x_client *client)
mutex_unlock(&clients_lock);
host1x_bo_cache_destroy(&client->cache);
return 0;
}
EXPORT_SYMBOL(host1x_client_unregister);

View File

@@ -474,7 +474,7 @@ int __host1x_client_register(struct host1x_client *client);
__host1x_client_register(client); \
})
int host1x_client_unregister(struct host1x_client *client);
void host1x_client_unregister(struct host1x_client *client);
int host1x_client_suspend(struct host1x_client *client);
int host1x_client_resume(struct host1x_client *client);