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
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.
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
14 This patch removes log_ret to solve this issue.
16 Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
18 drivers/clk/clk-uclass.c | 7 +------
19 1 file changed, 1 insertion(+), 6 deletions(-)
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)
26 const struct clk_ops *ops;
29 debug("%s(clk=%p)\n", __func__, clk);
31 @@ -481,11 +480,7 @@ ulong clk_get_rate(struct clk *clk)
35 - ret = ops->get_rate(clk);
37 - return log_ret(ret);
40 + return ops->get_rate(clk);
43 struct clk *clk_get_parent(struct clk *clk)