[U-Boot] [RFC 5/8] clk: Add generic_clk_valid

Jagan Teki jagan at amarulasolutions.com
Mon Jul 9 18:30:06 UTC 2018


Add clock validate function for validating
specific clock to do further clock operations.

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
 include/clk-uclass.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/clk-uclass.h b/include/clk-uclass.h
index e76d98e2f6..452eed008e 100644
--- a/include/clk-uclass.h
+++ b/include/clk-uclass.h
@@ -100,4 +100,14 @@ struct clk_ops {
 	int (*disable)(struct clk *clk);
 };
 
+/**
+ * generic_clk_valid() - check if clk port is valid
+ *
+ * @clk:	the clk port to check
+ * @return TRUE if valid, or FALSE
+ */
+static inline bool generic_clk_valid(struct clk *clk)
+{
+	return clk->dev != NULL;
+}
 #endif
-- 
2.17.1



More information about the U-Boot mailing list