1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

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>
This commit is contained in:
Fabrice Gasnier
2018-07-24 16:31:28 +02:00
committed by Tom Rini
parent 14aa210c1d
commit 1fe243a1e4
4 changed files with 32 additions and 0 deletions

View File

@@ -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