Commit bf3a3cdc authored by Qinglang Miao's avatar Qinglang Miao Committed by Thierry Reding

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: default avatarQinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 123f01a0
...@@ -3143,6 +3143,7 @@ static int tegra_sor_init(struct host1x_client *client) ...@@ -3143,6 +3143,7 @@ static int tegra_sor_init(struct host1x_client *client)
if (err < 0) { if (err < 0) {
dev_err(sor->dev, "failed to deassert SOR reset: %d\n", dev_err(sor->dev, "failed to deassert SOR reset: %d\n",
err); err);
clk_disable_unprepare(sor->clk);
return err; return err;
} }
...@@ -3150,12 +3151,17 @@ static int tegra_sor_init(struct host1x_client *client) ...@@ -3150,12 +3151,17 @@ static int tegra_sor_init(struct host1x_client *client)
} }
err = clk_prepare_enable(sor->clk_safe); err = clk_prepare_enable(sor->clk_safe);
if (err < 0) if (err < 0) {
clk_disable_unprepare(sor->clk);
return err; return err;
}
err = clk_prepare_enable(sor->clk_dp); 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 err;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment