[PATCH 13/22] clk: Change clk_core_init_rate_req prototype

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

The expectation is that a clk_rate_request structure is supposed to be
initialized using clk_core_init_rate_req(), yet the rate we want to
request still needs to be set by hand.

Let's just pass the rate as a function argument so that callers don't
have any extra work to do.

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

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 458c9fcf0349..399080456e45 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1375,13 +1375,15 @@ static int clk_core_determine_round_nolock(struct clk_core *core,
}

static void clk_core_init_rate_req(struct clk_core * const core,
- struct clk_rate_request *req)
+ struct clk_rate_request *req,
+ unsigned long rate)
{
struct clk_core *parent;

if (WARN_ON(!core || !req))
return;

+ req->rate = rate;
clk_core_get_boundaries(core, &req->min_rate, &req->max_rate);

parent = core->parent;
@@ -1409,7 +1411,7 @@ static int clk_core_round_rate_nolock(struct clk_core *core,
return 0;
}

- clk_core_init_rate_req(core, req);
+ clk_core_init_rate_req(core, req, req->rate);

if (clk_core_can_round(core))
return clk_core_determine_round_nolock(core, req);
@@ -1995,9 +1997,7 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core,
if (clk_core_can_round(core)) {
struct clk_rate_request req;

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

ret = clk_core_determine_round_nolock(core, &req);
if (ret < 0)
--
2.35.1