mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
clk: use private clk struct to access clock flags
There may be cases where the flags set for a clock is not available. This is usually the case with clocks which have been retrieved using clk_request(). However, clock flags are found in their respective private clock struct, so use that instead. Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
This commit is contained in:
committed by
Minkyu Kang
parent
67fea5775b
commit
07b8261d48
@@ -594,12 +594,13 @@ ulong clk_set_rate(struct clk *clk, ulong rate)
|
||||
if (!clk_valid(clk))
|
||||
return 0;
|
||||
ops = clk_dev_ops(clk->dev);
|
||||
clk_get_priv(clk, &clkp);
|
||||
|
||||
/* Try to find parents which can set rate */
|
||||
while (!ops->set_rate) {
|
||||
struct clk *parent;
|
||||
|
||||
if (!(clk->flags & CLK_SET_RATE_PARENT))
|
||||
if (!(clkp->flags & CLK_SET_RATE_PARENT))
|
||||
return -ENOSYS;
|
||||
|
||||
parent = clk_get_parent(clk);
|
||||
@@ -608,10 +609,9 @@ ulong clk_set_rate(struct clk *clk, ulong rate)
|
||||
|
||||
clk = parent;
|
||||
ops = clk_dev_ops(clk->dev);
|
||||
clk_get_priv(clk, &clkp);
|
||||
}
|
||||
|
||||
/* get private clock struct used for cache */
|
||||
clk_get_priv(clk, &clkp);
|
||||
/* Clean up cached rates for us and all child clocks */
|
||||
clk_clean_rate_cache(clkp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user