summaryrefslogtreecommitdiff
path: root/include/clk.h
diff options
context:
space:
mode:
authorFabrice Gasnier <fabrice.gasnier@st.com>2018-07-24 16:31:28 +0200
committerTom Rini <trini@konsulko.com>2018-08-03 19:53:10 -0400
commit1fe243a1e42fe99da0fa45c8c727f9c3d599c6c9 (patch)
treeeeaf0f029ccf5cc128a91ff889914ad6136b0f2a /include/clk.h
parent14aa210c1d4fb272ba2583b70f13505d3533015a (diff)
downloadu-boot-1fe243a1e42fe99da0fa45c8c727f9c3d599c6c9.tar.gz
u-boot-1fe243a1e42fe99da0fa45c8c727f9c3d599c6c9.tar.bz2
u-boot-1fe243a1e42fe99da0fa45c8c727f9c3d599c6c9.zip
clk: add clk_valid()
Add clk_valid() to check for optional clocks are valid. Call clk_valid() in test/dm/clk.c and add relevant test routine to sandbox clk tests. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/clk.h')
-rw-r--r--include/clk.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/clk.h b/include/clk.h
index 9a357646ff..f6d1cc53a1 100644
--- a/include/clk.h
+++ b/include/clk.h
@@ -294,4 +294,14 @@ int clk_disable_bulk(struct clk_bulk *bulk);
int soc_clk_dump(void);
+/**
+ * clk_valid() - check if clk is valid
+ *
+ * @clk: the clock to check
+ * @return true if valid, or false
+ */
+static inline bool clk_valid(struct clk *clk)
+{
+ return !!clk->dev;
+}
#endif