]> git.dujemihanovic.xyz Git - linux.git/commitdiff
clk: Change clk_core_init_rate_req prototype
authorMaxime Ripard <maxime@cerno.tech>
Tue, 16 Aug 2022 11:25:19 +0000 (13:25 +0200)
committerStephen Boyd <sboyd@kernel.org>
Thu, 15 Sep 2022 16:31:25 +0000 (09:31 -0700)
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.

Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # imx8mp
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> # exynos4210, meson g12b
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220816112530.1837489-15-maxime@cerno.tech
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk.c

index 91bb1ea0e147bdd6b6baff97fe51ca38f5b913af..75cfde9f917f97adba08a3c05c797d42646efdfe 100644 (file)
@@ -1380,13 +1380,16 @@ 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;
+
        parent = core->parent;
        if (parent) {
                req->best_parent_hw = parent->hw;
@@ -1412,7 +1415,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);
@@ -2004,11 +2007,10 @@ 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;
                req.min_rate = min_rate;
                req.max_rate = max_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)