diff options
Diffstat (limited to '')
-rw-r--r-- | drivers/clk/clk.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 53ac3a0e7..a8d68ac9d 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -244,6 +244,17 @@ static bool clk_core_is_enabled(struct clk_core *core) } } + /* + * This could be called with the enable lock held, or from atomic + * context. If the parent isn't enabled already, we can't do + * anything here. We can also assume this clock isn't enabled. + */ + if ((core->flags & CLK_OPS_PARENT_ENABLE) && core->parent) + if (!clk_core_is_enabled(core->parent)) { + ret = false; + goto done; + } + ret = core->ops->is_enabled(core->hw); done: if (core->dev) |