bcm27xx: add support for linux v5.15
[openwrt/staging/noltari.git] / target / linux / bcm27xx / patches-5.15 / 950-0849-clk-Change-clk_core_init_rate_req-prototype.patch
1 From ed9c0fcf492b3cc86bb573063785828c4df83809 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Sat, 2 Apr 2022 13:48:03 +0200
4 Subject: [PATCH] clk: Change clk_core_init_rate_req prototype
5
6 The expectation is that a clk_rate_request structure is supposed to be
7 initialized using clk_core_init_rate_req(), yet the rate we want to
8 request still needs to be set by hand.
9
10 Let's just pass the rate as a function argument so that callers don't
11 have any extra work to do.
12
13 Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # imx8mp
14 Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> # exynos4210, meson g12b
15 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
16 ---
17 drivers/clk/clk.c | 10 +++++-----
18 1 file changed, 5 insertions(+), 5 deletions(-)
19
20 --- a/drivers/clk/clk.c
21 +++ b/drivers/clk/clk.c
22 @@ -1374,13 +1374,15 @@ static int clk_core_determine_round_nolo
23 }
24
25 static void clk_core_init_rate_req(struct clk_core * const core,
26 - struct clk_rate_request *req)
27 + struct clk_rate_request *req,
28 + unsigned long rate)
29 {
30 struct clk_core *parent;
31
32 if (WARN_ON(!core || !req))
33 return;
34
35 + req->rate = rate;
36 clk_core_get_boundaries(core, &req->min_rate, &req->max_rate);
37
38 parent = core->parent;
39 @@ -1408,7 +1410,7 @@ static int clk_core_round_rate_nolock(st
40 return 0;
41 }
42
43 - clk_core_init_rate_req(core, req);
44 + clk_core_init_rate_req(core, req, req->rate);
45
46 if (clk_core_can_round(core))
47 return clk_core_determine_round_nolock(core, req);
48 @@ -1994,9 +1996,7 @@ static struct clk_core *clk_calc_new_rat
49 if (clk_core_can_round(core)) {
50 struct clk_rate_request req;
51
52 - req.rate = rate;
53 -
54 - clk_core_init_rate_req(core, &req);
55 + clk_core_init_rate_req(core, &req, rate);
56
57 ret = clk_core_determine_round_nolock(core, &req);
58 if (ret < 0)