aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2016-02-11 16:19:10 -0500
committerMichael Turquette <mturquette@baylibre.com>2016-04-09 14:58:10 -0400
commit2e20fbf592621b2c2aeddd82e0fa3dad053cce03 (patch)
treec29456bb2133a5891c8318dde2d71a271580adb1 /drivers/clk
parent32b9b10961860860268961d9aad0c56a73018c37 (diff)
clk: WARN_ON about to disable a critical clock
Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Michael Turquette <mturquette@baylibre.com> Link: lkml.kernel.org/r/1455225554-13267-3-git-send-email-mturquette@baylibre.com
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 275201fd7b01..dede0ce679e4 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -574,6 +574,9 @@ static void clk_core_unprepare(struct clk_core *core)
574 if (WARN_ON(core->prepare_count == 0)) 574 if (WARN_ON(core->prepare_count == 0))
575 return; 575 return;
576 576
577 if (WARN_ON(core->prepare_count == 1 && core->flags & CLK_IS_CRITICAL))
578 return;
579
577 if (--core->prepare_count > 0) 580 if (--core->prepare_count > 0)
578 return; 581 return;
579 582
@@ -679,6 +682,9 @@ static void clk_core_disable(struct clk_core *core)
679 if (WARN_ON(core->enable_count == 0)) 682 if (WARN_ON(core->enable_count == 0))
680 return; 683 return;
681 684
685 if (WARN_ON(core->enable_count == 1 && core->flags & CLK_IS_CRITICAL))
686 return;
687
682 if (--core->enable_count > 0) 688 if (--core->enable_count > 0)
683 return; 689 return;
684 690