summaryrefslogtreecommitdiff
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@kernel.org>2019-12-26 14:11:43 -0800
committerStephen Boyd <sboyd@kernel.org>2019-12-26 14:11:43 -0800
commit67d81d7a2ef388c66b472140e0d3f2d04e4da713 (patch)
tree2fe4c2536d15f5225eae30460ccbf221b3aaafe8 /drivers/clk/clk.c
parent4ba9822bcd2aa3456c99262dc4c3aeb27d8b5b8a (diff)
parent12ead77432f2ce32dea797742316d15c5800cb32 (diff)
Merge branch 'clk-fixes' into clk-next
* clk-fixes: clk: Don't try to enable critical clocks if prepare failed
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 7ea44e4ac547..70c599e92f7c 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3435,11 +3435,17 @@ static int __clk_core_init(struct clk_core *core)
if (core->flags & CLK_IS_CRITICAL) {
unsigned long flags;
- clk_core_prepare(core);
+ ret = clk_core_prepare(core);
+ if (ret)
+ goto out;
flags = clk_enable_lock();
- clk_core_enable(core);
+ ret = clk_core_enable(core);
clk_enable_unlock(flags);
+ if (ret) {
+ clk_core_unprepare(core);
+ goto out;
+ }
}
clk_core_reparent_orphans_nolock();