uboot-mediatek: update to v2023.04
[openwrt/staging/dedeckeh.git] / package / boot / uboot-mediatek / patches / 100-00-clk-remove-log_ret-from-clk_get_rate.patch
1 From 19f2aa053d5531a9ca0ece04dca172a522d58b90 Mon Sep 17 00:00:00 2001
2 From: Weijie Gao <weijie.gao@mediatek.com>
3 Date: Fri, 29 Jul 2022 11:32:28 +0800
4 Subject: [PATCH 32/71] clk: remove log_ret from clk_get_rate
5
6 The return value of clk_get_rate is ulong, an unsigned type. The size of
7 ulong depends on the cpu architecture, i.e. 4 bytes on 32-bit CPUs and
8 8 bytes on 64-bit CPUs.
9
10 However log_ret only accepts and returns value in int type, a fixed 4-byte
11 type. This may truncate the real clock value and cause unexpected error on
12 64-bit platforms.
13
14 This patch removes log_ret to solve this issue.
15
16 Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
17 ---
18 drivers/clk/clk-uclass.c | 7 +------
19 1 file changed, 1 insertion(+), 6 deletions(-)
20
21 --- a/drivers/clk/clk-uclass.c
22 +++ b/drivers/clk/clk-uclass.c
23 @@ -471,7 +471,6 @@ void clk_free(struct clk *clk)
24 ulong clk_get_rate(struct clk *clk)
25 {
26 const struct clk_ops *ops;
27 - int ret;
28
29 debug("%s(clk=%p)\n", __func__, clk);
30 if (!clk_valid(clk))
31 @@ -481,11 +480,7 @@ ulong clk_get_rate(struct clk *clk)
32 if (!ops->get_rate)
33 return -ENOSYS;
34
35 - ret = ops->get_rate(clk);
36 - if (ret)
37 - return log_ret(ret);
38 -
39 - return 0;
40 + return ops->get_rate(clk);
41 }
42
43 struct clk *clk_get_parent(struct clk *clk)