Commit 11c84a38 authored by Maxime Ripard's avatar Maxime Ripard Committed by Stephen Boyd

clk: Add our request boundaries in clk_core_init_rate_req

The expectation is that a new clk_rate_request is initialized through a
call to clk_core_init_rate_req().

However, at the moment it only fills the parent rate and clk_hw pointer,
but omits the other fields such as the clock rate boundaries.

Some users of that function will update them after calling it, but most
don't.

As we are passed the clk_core pointer, we have access to those
boundaries in clk_core_init_rate_req() however, so let's just fill it
there and remove it from the few callers that do it right.

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: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220816112530.1837489-18-maxime@cerno.techTested-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
Tested-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent c35e84b0
......@@ -1389,6 +1389,7 @@ static void clk_core_init_rate_req(struct clk_core * const core,
return;
req->rate = rate;
clk_core_get_boundaries(core, &req->min_rate, &req->max_rate);
parent = core->parent;
if (parent) {
......@@ -1483,7 +1484,6 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate)
struct clk_rate_request req;
clk_core_init_rate_req(hw->core, &req, rate);
clk_core_get_boundaries(hw->core, &req.min_rate, &req.max_rate);
ret = clk_core_round_rate_nolock(hw->core, &req);
if (ret)
......@@ -1516,7 +1516,6 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
clk_core_rate_unprotect(clk->core);
clk_core_init_rate_req(clk->core, &req, rate);
clk_core_get_boundaries(clk->core, &req.min_rate, &req.max_rate);
ret = clk_core_round_rate_nolock(clk->core, &req);
......@@ -2025,9 +2024,6 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core,
if (clk_core_can_round(core)) {
struct clk_rate_request req;
req.min_rate = min_rate;
req.max_rate = max_rate;
clk_core_init_rate_req(core, &req, rate);
ret = clk_core_determine_round_nolock(core, &req);
......@@ -2228,7 +2224,6 @@ static unsigned long clk_core_req_round_rate_nolock(struct clk_core *core,
return cnt;
clk_core_init_rate_req(core, &req, req_rate);
clk_core_get_boundaries(core, &req.min_rate, &req.max_rate);
ret = clk_core_round_rate_nolock(core, &req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment