Skip to content

Commit dd742ca

Browse files
claudiubezneabebarino
authored andcommitted
clk: use clk_core_get_rate_recalc() in clk_rate_get()
In case clock flags contains CLK_GET_RATE_NOCACHE the clk_rate_get() will return the cached rate. Thus, use clk_core_get_rate_recalc() which takes proper action when clock flags contains CLK_GET_RATE_NOCACHE. Signed-off-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Nicolas Ferre <[email protected]> [[email protected]: Grab prepare lock around operation] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 6880fa6 commit dd742ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/clk/clk.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3108,7 +3108,10 @@ static int clk_rate_get(void *data, u64 *val)
31083108
{
31093109
struct clk_core *core = data;
31103110

3111-
*val = core->rate;
3111+
clk_prepare_lock();
3112+
*val = clk_core_get_rate_recalc(core);
3113+
clk_prepare_unlock();
3114+
31123115
return 0;
31133116
}
31143117

0 commit comments

Comments
 (0)