Skip to content

Commit 11c84a3

Browse files
mripardbebarino
authored andcommitted
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: Maxime Ripard <maxime@cerno.tech> Link: https://lore.kernel.org/r/20220816112530.1837489-18-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>
1 parent c35e84b commit 11c84a3

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/clk/clk.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,6 +1389,7 @@ static void clk_core_init_rate_req(struct clk_core * const core,
13891389
return;
13901390

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

13931394
parent = core->parent;
13941395
if (parent) {
@@ -1483,7 +1484,6 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate)
14831484
struct clk_rate_request req;
14841485

14851486
clk_core_init_rate_req(hw->core, &req, rate);
1486-
clk_core_get_boundaries(hw->core, &req.min_rate, &req.max_rate);
14871487

14881488
ret = clk_core_round_rate_nolock(hw->core, &req);
14891489
if (ret)
@@ -1516,7 +1516,6 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
15161516
clk_core_rate_unprotect(clk->core);
15171517

15181518
clk_core_init_rate_req(clk->core, &req, rate);
1519-
clk_core_get_boundaries(clk->core, &req.min_rate, &req.max_rate);
15201519

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

@@ -2025,9 +2024,6 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core,
20252024
if (clk_core_can_round(core)) {
20262025
struct clk_rate_request req;
20272026

2028-
req.min_rate = min_rate;
2029-
req.max_rate = max_rate;
2030-
20312027
clk_core_init_rate_req(core, &req, rate);
20322028

20332029
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,
22282224
return cnt;
22292225

22302226
clk_core_init_rate_req(core, &req, req_rate);
2231-
clk_core_get_boundaries(core, &req.min_rate, &req.max_rate);
22322227

22332228
ret = clk_core_round_rate_nolock(core, &req);
22342229

0 commit comments

Comments
 (0)