bcm27xx: add support for linux v5.15
[openwrt/staging/jow.git] / target / linux / bcm27xx / patches-5.15 / 950-0851-clk-Add-missing-clk_core_init_rate_req-calls.patch
1 From 2e9c468b513031e497d0133d7a2e396cb29d70c3 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Sat, 2 Apr 2022 14:01:37 +0200
4 Subject: [PATCH] clk: Add missing clk_core_init_rate_req calls
5
6 Some callers of clk_core_round_rate_nolock() will initialize the
7 clk_rate_request structure by hand, missing a few parameters that leads
8 to inconsistencies in what drivers can expect from that structure.
9
10 Let's use clk_core_init_rate_req() everywhere to make sure it's built in
11 a consistent manner.
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 | 7 +++----
18 1 file changed, 3 insertions(+), 4 deletions(-)
19
20 --- a/drivers/clk/clk.c
21 +++ b/drivers/clk/clk.c
22 @@ -1479,7 +1479,7 @@ unsigned long clk_hw_round_rate(struct c
23 int ret;
24 struct clk_rate_request req;
25
26 - req.rate = rate;
27 + clk_core_init_rate_req(hw->core, &req, rate);
28
29 ret = clk_core_round_rate_nolock(hw->core, &req);
30 if (ret)
31 @@ -1511,7 +1511,7 @@ long clk_round_rate(struct clk *clk, uns
32 if (clk->exclusive_count)
33 clk_core_rate_unprotect(clk->core);
34
35 - req.rate = rate;
36 + clk_core_init_rate_req(clk->core, &req, rate);
37
38 ret = clk_core_round_rate_nolock(clk->core, &req);
39
40 @@ -2215,8 +2215,7 @@ static unsigned long clk_core_req_round_
41 if (cnt < 0)
42 return cnt;
43
44 - clk_core_get_boundaries(core, &req.min_rate, &req.max_rate);
45 - req.rate = req_rate;
46 + clk_core_init_rate_req(core, &req, req_rate);
47
48 ret = clk_core_round_rate_nolock(core, &req);
49