linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] clk: Add is_enabled sanity check
@ 2016-05-17  2:03 Jun Nie
  0 siblings, 0 replies; only message in thread
From: Jun Nie @ 2016-05-17  2:03 UTC (permalink / raw)
  To: sboyd, mturquette, linux-clk; +Cc: Jun Nie

If .enable and .disable is implemented, we must implement .is_enabled
per document. Otherwise, clk_disable_unused_subtree will not disable
the unused clock if the .is_enabled is not implemented, unecessary
power consumption happens on the clock as a result.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
 drivers/clk/clk.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index fb74dc1..55f5c44 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2305,6 +2305,10 @@ static int __clk_core_init(struct clk_core *core)
 		goto out;
 	}
 
+	if (core->ops->enable && !core->ops->is_enabled)
+		pr_warn("Warning: %s %s must implement .is_enabled\n",
+			__func__, core->name);
+
 	/* throw a WARN if any entries in parent_names are NULL */
 	for (i = 0; i < core->num_parents; i++)
 		WARN(!core->parent_names[i],
-- 
2.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-17  2:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-17  2:03 [PATCH v2] clk: Add is_enabled sanity check Jun Nie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).