summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2022-10-22 08:08:55 +0200
committerShawn Guo <shawnguo@kernel.org>2022-10-29 16:26:32 +0800
commit0ba7b623f15d52fa056eca26573d8cf1b9c29fd1 (patch)
tree2f96c9eaeca5504165b9e663f69fe9df7166d135 /drivers/soc
parentd92a110130d492bd5eab81827ce3730581dc933a (diff)
downloadlinux-stable-0ba7b623f15d52fa056eca26573d8cf1b9c29fd1.tar.gz
linux-stable-0ba7b623f15d52fa056eca26573d8cf1b9c29fd1.tar.bz2
linux-stable-0ba7b623f15d52fa056eca26573d8cf1b9c29fd1.zip
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: 0a0f7cc25d4a ("soc: imx: add i.MX93 SRC power domain driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/imx/imx93-pd.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/soc/imx/imx93-pd.c b/drivers/soc/imx/imx93-pd.c
index 1f3d7039c1de..4d235c8c4924 100644
--- a/drivers/soc/imx/imx93-pd.c
+++ b/drivers/soc/imx/imx93-pd.c
@@ -135,11 +135,24 @@ static int imx93_pd_probe(struct platform_device *pdev)
ret = pm_genpd_init(&domain->genpd, NULL, domain->init_off);
if (ret)
- return ret;
+ goto err_clk_unprepare;
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[] = {