mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 12:56:00 +01:00
clk: Fix rate caching in clk_get_parent_rate()
clk_get_rate() can return an error value. Recompute the rate if the cached value is an error value. Fixes: 4aa78300a025 ("dm: clk: Define clk_get_parent_rate() for clk operations") Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
parent
8de411e06a
commit
2efb8e6f66
@ -520,7 +520,8 @@ ulong clk_get_parent_rate(struct clk *clk)
|
|||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
|
||||||
/* Read the 'rate' if not already set or if proper flag set*/
|
/* Read the 'rate' if not already set or if proper flag set*/
|
||||||
if (!pclk->rate || pclk->flags & CLK_GET_RATE_NOCACHE)
|
if (!pclk->rate || IS_ERR_VALUE(pclk->rate) ||
|
||||||
|
pclk->flags & CLK_GET_RATE_NOCACHE)
|
||||||
pclk->rate = clk_get_rate(pclk);
|
pclk->rate = clk_get_rate(pclk);
|
||||||
|
|
||||||
return pclk->rate;
|
return pclk->rate;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user