Skip to content

Commit bde8870

Browse files
mripardbebarino
authored andcommitted
clk: Clarify clk_get_rate() expectations
As shown by a number of clock users already, clk_get_rate() can be called whether or not the clock is enabled. Similarly, a number of clock drivers will return a rate of 0 whenever the rate cannot be figured out. Since it was a bit ambiguous before, let's make it clear in the clk_get_rate() documentation. Signed-off-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Linux Kernel Functional Testing <[email protected]> Tested-by: Naresh Kamboju <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent f24a0b1 commit bde8870

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/clk/clk.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,8 +1672,9 @@ static unsigned long clk_core_get_rate_recalc(struct clk_core *core)
16721672
* @clk: the clk whose rate is being returned
16731673
*
16741674
* Simply returns the cached rate of the clk, unless CLK_GET_RATE_NOCACHE flag
1675-
* is set, which means a recalc_rate will be issued.
1676-
* If clk is NULL then returns 0.
1675+
* is set, which means a recalc_rate will be issued. Can be called regardless of
1676+
* the clock enabledness. If clk is NULL, or if an error occurred, then returns
1677+
* 0.
16771678
*/
16781679
unsigned long clk_get_rate(struct clk *clk)
16791680
{

0 commit comments

Comments
 (0)