summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tegra
diff options
context:
space:
mode:
authorQinglang Miao <miaoqinglang@huawei.com>2020-10-30 04:34:24 +0300
committerThierry Reding <treding@nvidia.com>2020-11-26 20:44:48 +0300
commitbf3a3cdcad40e5928a22ea0fd200d17fd6d6308d (patch)
tree713b27b755121f9f3bf52287e8e395041fb1c752 /drivers/gpu/drm/tegra
parent123f01a0c989905a1cef6c1397a022eb321474d8 (diff)
downloadlinux-bf3a3cdcad40e5928a22ea0fd200d17fd6d6308d.tar.xz
drm/tegra: sor: Disable clocks on error in tegra_sor_init()
Fix the missing clk_disable_unprepare() before return from tegra_sor_init() in the error handling case. Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra')
-rw-r--r--drivers/gpu/drm/tegra/sor.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 00656d8b98e2..cc2aa2308a51 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -3143,6 +3143,7 @@ static int tegra_sor_init(struct host1x_client *client)
if (err < 0) {
dev_err(sor->dev, "failed to deassert SOR reset: %d\n",
err);
+ clk_disable_unprepare(sor->clk);
return err;
}
@@ -3150,12 +3151,17 @@ static int tegra_sor_init(struct host1x_client *client)
}
err = clk_prepare_enable(sor->clk_safe);
- if (err < 0)
+ if (err < 0) {
+ clk_disable_unprepare(sor->clk);
return err;
+ }
err = clk_prepare_enable(sor->clk_dp);
- if (err < 0)
+ if (err < 0) {
+ clk_disable_unprepare(sor->clk_safe);
+ clk_disable_unprepare(sor->clk);
return err;
+ }
return 0;
}