1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
From ed9c0fcf492b3cc86bb573063785828c4df83809 Mon Sep 17 00:00:00 2001
From: Maxime Ripard <maxime@cerno.tech>
Date: Sat, 2 Apr 2022 13:48:03 +0200
Subject: [PATCH] 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>
---
drivers/clk/clk.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1373,13 +1373,15 @@ static int clk_core_determine_round_nolo
}
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;
@@ -1407,7 +1409,7 @@ static int clk_core_round_rate_nolock(st
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);
@@ -1993,9 +1995,7 @@ static struct clk_core *clk_calc_new_rat
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)
|