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

Jagan Teki jagan at amarulasolutions.com
Mon Jul 30 12:56:22 UTC 2018


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

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
 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.18.0.321.gffc6fa0e3



More information about the U-Boot mailing list