Add clock validate function for validating specific clock to do further clock operations.
Signed-off-by: Jagan Teki <ja...@amarulasolutions.com> Reviewed-by: Simon Glass <s...@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 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot