[PATCH 2/6] clk: Fix error handling in clk_get_rate()
Samuel Holland
samuel at sholland.org
Mon Feb 20 06:59:35 CET 2023
log_ret() cannot work with unsigned values, and the assignment to 'ret'
incorrectly truncates the rate from long to int.
Fixes: 5c5992cb90cf ("clk: Add debugging for return values")
Signed-off-by: Samuel Holland <samuel at sholland.org>
---
drivers/clk/clk-uclass.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index dc3e9d6a261..78299dbceb2 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -471,7 +471,6 @@ void clk_free(struct clk *clk)
ulong clk_get_rate(struct clk *clk)
{
const struct clk_ops *ops;
- int ret;
debug("%s(clk=%p)\n", __func__, clk);
if (!clk_valid(clk))
@@ -481,11 +480,7 @@ ulong clk_get_rate(struct clk *clk)
if (!ops->get_rate)
return -ENOSYS;
- ret = ops->get_rate(clk);
- if (ret)
- return log_ret(ret);
-
- return 0;
+ return ops->get_rate(clk);
}
struct clk *clk_get_parent(struct clk *clk)
--
2.39.2
More information about the U-Boot
mailing list