diff options
Diffstat (limited to 'drivers/gpu/drm/tegra/nvdec.c')
| -rw-r--r-- | drivers/gpu/drm/tegra/nvdec.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/drivers/gpu/drm/tegra/nvdec.c b/drivers/gpu/drm/tegra/nvdec.c index 86c5818ac27b..7a38664e890e 100644 --- a/drivers/gpu/drm/tegra/nvdec.c +++ b/drivers/gpu/drm/tegra/nvdec.c @@ -11,8 +11,6 @@ #include <linux/iopoll.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> -#include <linux/of_platform.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/reset.h> @@ -177,13 +175,9 @@ static int nvdec_init(struct host1x_client *client) goto free_channel; } - pm_runtime_enable(client->dev); - pm_runtime_use_autosuspend(client->dev); - pm_runtime_set_autosuspend_delay(client->dev, 500); - err = tegra_drm_register_client(tegra, drm); if (err < 0) - goto disable_rpm; + goto free_syncpt; /* * Inherit the DMA parameters (such as maximum segment size) from the @@ -193,10 +187,7 @@ static int nvdec_init(struct host1x_client *client) return 0; -disable_rpm: - pm_runtime_dont_use_autosuspend(client->dev); - pm_runtime_force_suspend(client->dev); - +free_syncpt: host1x_syncpt_put(client->syncpts[0]); free_channel: host1x_channel_put(nvdec->channel); @@ -270,12 +261,12 @@ static int nvdec_load_falcon_firmware(struct nvdec *nvdec) if (!client->group) { virt = dma_alloc_coherent(nvdec->dev, size, &iova, GFP_KERNEL); - - err = dma_mapping_error(nvdec->dev, iova); - if (err < 0) - return err; + if (!virt) + return -ENOMEM; } else { virt = tegra_drm_alloc(tegra, size, &iova); + if (IS_ERR(virt)) + return PTR_ERR(virt); } nvdec->falcon.firmware.virt = virt; @@ -539,6 +530,10 @@ static int nvdec_probe(struct platform_device *pdev) goto exit_falcon; } + pm_runtime_enable(dev); + pm_runtime_use_autosuspend(dev); + pm_runtime_set_autosuspend_delay(dev, 500); + return 0; exit_falcon: @@ -547,21 +542,13 @@ exit_falcon: return err; } -static int nvdec_remove(struct platform_device *pdev) +static void 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; - } + pm_runtime_disable(&pdev->dev); + host1x_client_unregister(&nvdec->client.base); falcon_exit(&nvdec->falcon); - - return 0; } static const struct dev_pm_ops nvdec_pm_ops = { |
