[PATCH 15/22] clk: Add missing clk_core_init_rate_req calls

Maxime Ripard
2022-04-08T09:14:14Z

Some callers of clk_core_round_rate_nolock() will initialize the
clk_rate_request structure by hand, missing a few parameters that leads
to inconsistencies in what drivers can expect from that structure.

Let's use clk_core_init_rate_req() everywhere to make sure it's built in
a consistent manner.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
drivers/clk/clk.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 83dd5f1df0b9..3a59152b06b8 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1480,7 +1480,7 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate)
int ret;
struct clk_rate_request req;

- req.rate = rate;
+ clk_core_init_rate_req(hw->core, &req, rate);

ret = clk_core_round_rate_nolock(hw->core, &req);
if (ret)
@@ -1512,7 +1512,7 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
if (clk->exclusive_count)
clk_core_rate_unprotect(clk->core);

- req.rate = rate;
+ clk_core_init_rate_req(clk->core, &req, rate);

ret = clk_core_round_rate_nolock(clk->core, &req);

@@ -2216,8 +2216,7 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core,
if (cnt < 0)
return cnt;

- clk_core_get_boundaries(core, &req.min_rate, &req.max_rate);
- req.rate = req_rate;
+ clk_core_init_rate_req(core, &req, req_rate);

ret = clk_core_round_rate_nolock(core, &req);

--
2.35.1