[U-Boot] [PATCH 1/6] clk: add clk_valid()

Fabrice Gasnier fabrice.gasnier at st.com
Mon Jul 23 12:35:50 UTC 2018


add clk_valid() to check for optional clocks are valid.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier at st.com>
---

 include/clk.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/clk.h b/include/clk.h
index 9a35764..71679a9 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
-- 
1.9.1



More information about the U-Boot mailing list