drm/tegra: dc: Release PM and RGB output when client's registration fails
authorDmitry Osipenko <digetx@gmail.com>
Sun, 8 Mar 2020 22:38:08 +0000 (01:38 +0300)
committerThierry Reding <treding@nvidia.com>
Thu, 12 Mar 2020 09:26:19 +0000 (10:26 +0100)
Runtime PM and RGB output need to be released when host1x client
registration fails. The releasing is missed in the code, let's correct it.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/dc.c

index 257163dda30173c6105579477d9a3805b33efcde..56d933e81797668140f5cccfe95887caab59ebcd 100644 (file)
@@ -2586,10 +2586,16 @@ static int tegra_dc_probe(struct platform_device *pdev)
        if (err < 0) {
                dev_err(&pdev->dev, "failed to register host1x client: %d\n",
                        err);
-               return err;
+               goto disable_pm;
        }
 
        return 0;
+
+disable_pm:
+       pm_runtime_disable(&pdev->dev);
+       tegra_dc_rgb_remove(dc);
+
+       return err;
 }
 
 static int tegra_dc_remove(struct platform_device *pdev)