drm/tegra: rgb: Fix some error handling paths in tegra_dc_rgb_probe()
If an error occurs after calling tegra_output_probe(), tegra_output_remove() should be called as already done in the remove function. Fixes: 59d29c0ec93f ("drm/tegra: Allocate resources at probe time") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/0001f61eb89048bc36241629b564195689cf54b6.1693667005.git.christophe.jaillet@wanadoo.fr
This commit is contained in:
parent
643ae131b8
commit
bc456b5d93
@ -225,26 +225,28 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc)
|
||||
rgb->clk = devm_clk_get(dc->dev, NULL);
|
||||
if (IS_ERR(rgb->clk)) {
|
||||
dev_err(dc->dev, "failed to get clock\n");
|
||||
return PTR_ERR(rgb->clk);
|
||||
err = PTR_ERR(rgb->clk);
|
||||
goto remove;
|
||||
}
|
||||
|
||||
rgb->clk_parent = devm_clk_get(dc->dev, "parent");
|
||||
if (IS_ERR(rgb->clk_parent)) {
|
||||
dev_err(dc->dev, "failed to get parent clock\n");
|
||||
return PTR_ERR(rgb->clk_parent);
|
||||
err = PTR_ERR(rgb->clk_parent);
|
||||
goto remove;
|
||||
}
|
||||
|
||||
err = clk_set_parent(rgb->clk, rgb->clk_parent);
|
||||
if (err < 0) {
|
||||
dev_err(dc->dev, "failed to set parent clock: %d\n", err);
|
||||
return err;
|
||||
goto remove;
|
||||
}
|
||||
|
||||
rgb->pll_d_out0 = clk_get_sys(NULL, "pll_d_out0");
|
||||
if (IS_ERR(rgb->pll_d_out0)) {
|
||||
err = PTR_ERR(rgb->pll_d_out0);
|
||||
dev_err(dc->dev, "failed to get pll_d_out0: %d\n", err);
|
||||
return err;
|
||||
goto remove;
|
||||
}
|
||||
|
||||
if (dc->soc->has_pll_d2_out0) {
|
||||
@ -252,13 +254,17 @@ int tegra_dc_rgb_probe(struct tegra_dc *dc)
|
||||
if (IS_ERR(rgb->pll_d2_out0)) {
|
||||
err = PTR_ERR(rgb->pll_d2_out0);
|
||||
dev_err(dc->dev, "failed to get pll_d2_out0: %d\n", err);
|
||||
return err;
|
||||
goto remove;
|
||||
}
|
||||
}
|
||||
|
||||
dc->rgb = &rgb->output;
|
||||
|
||||
return 0;
|
||||
|
||||
remove:
|
||||
tegra_output_remove(&rgb->output);
|
||||
return err;
|
||||
}
|
||||
|
||||
void tegra_dc_rgb_remove(struct tegra_dc *dc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user