gpu: host1x: Make host1x_client_unregister() return void

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

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>
This commit is contained in:
Uwe Kleine-König 2023-03-22 18:02:12 +01:00 committed by Thierry Reding
parent 22b9442a6a
commit 1d83d1a2df
13 changed files with 15 additions and 81 deletions

View File

@ -3268,12 +3268,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

@ -298,14 +298,8 @@ 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;
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,14 +553,8 @@ 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;
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

@ -1877,14 +1877,8 @@ 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;
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

@ -550,14 +550,8 @@ exit_falcon:
static int nvdec_remove(struct platform_device *pdev)
{
struct nvdec *nvdec = platform_get_drvdata(pdev);
int 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

@ -3981,14 +3981,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

@ -540,14 +540,8 @@ exit_falcon:
static int vic_remove(struct platform_device *pdev)
{
struct vic *vic = platform_get_drvdata(pdev);
int 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

@ -803,7 +803,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;
@ -815,7 +815,7 @@ int host1x_client_unregister(struct host1x_client *client)
err = host1x_del_client(host1x, client);
if (!err) {
mutex_unlock(&devices_lock);
return 0;
return;
}
}
@ -832,8 +832,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

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

View File

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

View File

@ -443,7 +443,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);