diff options
author | Julien Masson | 2023-12-15 15:09:43 +0100 |
---|---|---|
committer | Sean Anderson | 2024-01-29 22:34:52 -0500 |
commit | b500447ad6aef31de75e3e9242101ae96eceb7ca (patch) | |
tree | 20e04624eb5e7bb2a999c1a3b657be56a203b47f | |
parent | 2da1331d20b34fb9b7ff41ddaf622dd880965a02 (diff) |
clk: fix clk_get_rate() always return ulong
When we call clk_get_rate(), we expect to get clock rate value as
ulong.
In that case we should not use log_ret() macro since it use internally
an int.
Otherwise we may return an invalid/truncated clock rate value.
Signed-off-by: Julien Masson <jmasson@baylibre.com>
Fixes: 5c5992cb90c ("clk: Add debugging for return values")
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/87o7erv9p4.fsf@baylibre.com
-rw-r--r-- | drivers/clk/clk-uclass.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 3e9d68feb3c..d5e20071859 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -478,7 +478,6 @@ void clk_free(struct clk *clk) ulong clk_get_rate(struct clk *clk) { const struct clk_ops *ops; - ulong ret; debug("%s(clk=%p)\n", __func__, clk); if (!clk_valid(clk)) @@ -488,11 +487,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) |