Commit 0ba7b623 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Shawn Guo

soc: imx: imx93-pd: Fix the error handling path of imx93_pd_probe()

In imx93_pd_probe(); if an error occurs, some resources need to be released
as done in the remove function.

Fixes: 0a0f7cc2 ("soc: imx: add i.MX93 SRC power domain driver")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent d92a1101
...@@ -135,11 +135,24 @@ static int imx93_pd_probe(struct platform_device *pdev) ...@@ -135,11 +135,24 @@ static int imx93_pd_probe(struct platform_device *pdev)
ret = pm_genpd_init(&domain->genpd, NULL, domain->init_off); ret = pm_genpd_init(&domain->genpd, NULL, domain->init_off);
if (ret) if (ret)
return ret; goto err_clk_unprepare;
platform_set_drvdata(pdev, domain); platform_set_drvdata(pdev, domain);
return of_genpd_add_provider_simple(np, &domain->genpd); ret = of_genpd_add_provider_simple(np, &domain->genpd);
if (ret)
goto err_genpd_remove;
return 0;
err_genpd_remove:
pm_genpd_remove(&domain->genpd);
err_clk_unprepare:
if (!domain->init_off)
clk_bulk_disable_unprepare(domain->num_clks, domain->clks);
return ret;
} }
static const struct of_device_id imx93_pd_ids[] = { static const struct of_device_id imx93_pd_ids[] = {
......
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