Skip to content

Commit 718af79

Browse files
mripardbebarino
authored andcommitted
clk: Change clk_core_init_rate_req prototype
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>
1 parent cb1b1dd commit 718af79

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/clk/clk.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,13 +1380,16 @@ static int clk_core_determine_round_nolock(struct clk_core *core,
13801380
}
13811381

13821382
static void clk_core_init_rate_req(struct clk_core * const core,
1383-
struct clk_rate_request *req)
1383+
struct clk_rate_request *req,
1384+
unsigned long rate)
13841385
{
13851386
struct clk_core *parent;
13861387

13871388
if (WARN_ON(!core || !req))
13881389
return;
13891390

1391+
req->rate = rate;
1392+
13901393
parent = core->parent;
13911394
if (parent) {
13921395
req->best_parent_hw = parent->hw;
@@ -1412,7 +1415,7 @@ static int clk_core_round_rate_nolock(struct clk_core *core,
14121415
return 0;
14131416
}
14141417

1415-
clk_core_init_rate_req(core, req);
1418+
clk_core_init_rate_req(core, req, req->rate);
14161419

14171420
if (clk_core_can_round(core))
14181421
return clk_core_determine_round_nolock(core, req);
@@ -2004,11 +2007,10 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core,
20042007
if (clk_core_can_round(core)) {
20052008
struct clk_rate_request req;
20062009

2007-
req.rate = rate;
20082010
req.min_rate = min_rate;
20092011
req.max_rate = max_rate;
20102012

2011-
clk_core_init_rate_req(core, &req);
2013+
clk_core_init_rate_req(core, &req, rate);
20122014

20132015
ret = clk_core_determine_round_nolock(core, &req);
20142016
if (ret < 0)

0 commit comments

Comments
 (0)