summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2015-12-27 13:46:28 +0100
committerStefan Agner <stefan.agner@toradex.com>2016-03-08 10:22:54 -0800
commit0824a2b7aa7e1f7ea6accad280b6e4d8f1b9a3c9 (patch)
treecff231957a14c318471910fd77eac0b9e90c6273
parent98bd680b30cb1b091b648db4cd250f5022b2ee7d (diff)
ARM: imx: gpc: exit with error if IPG clock is missing
If IPG clock of the GPC block is missing, we won't be able to get the IPG bus clock later on. Return with an error if the IPG clock is missing. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> [exit with error on missing IPG clock] Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--arch/arm/mach-imx/gpc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index 6ee4127afb3f..4649e3877638 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -623,6 +623,7 @@ static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg)
bool is_off;
int pu_clks, disp_clks, ipg_clks = 1;
int i = 0, k = 0;
+ int ret = 0;
/* No pu and display misc on i.mx6ul */
if (cpu_is_imx6ul())
@@ -655,6 +656,11 @@ static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg)
imx6q_pu_domain.num_clks = i;
ipg = of_clk_get(dev->of_node, pu_clks);
+ if(IS_ERR(ipg)) {
+ pr_err("%s, Couldn't get IPG clock from dtb gpc node.\n",__func__);
+ ret = PTR_ERR(ipg);
+ goto err_ipg_clk;
+ }
/* Get disp domain clks */
for (k = 0, i = pu_clks + ipg_clks; i < pu_clks + ipg_clks + disp_clks;
@@ -677,6 +683,11 @@ static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg)
return __of_genpd_add_provider(dev->of_node, __of_genpd_xlate_onecell,
&imx_gpc_onecell_data);
+err_ipg_clk:
+ for (i = 0; i < pu_clks ; i++)
+ clk_put(imx6q_pu_domain.clk[i]);
+
+ return ret;
}
#else