clk: Fix error handling in clk_get_rate()

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@sholland.org>
This commit is contained in:
Samuel Holland 2022-12-02 00:34:25 -06:00
parent 221c48b423
commit bae28dd7f7

View File

@ -471,7 +471,6 @@ void clk_free(struct clk *clk)
ulong clk_get_rate(struct clk *clk) ulong clk_get_rate(struct clk *clk)
{ {
const struct clk_ops *ops; const struct clk_ops *ops;
int ret;
debug("%s(clk=%p)\n", __func__, clk); debug("%s(clk=%p)\n", __func__, clk);
if (!clk_valid(clk)) if (!clk_valid(clk))
@ -481,11 +480,7 @@ ulong clk_get_rate(struct clk *clk)
if (!ops->get_rate) if (!ops->get_rate)
return -ENOSYS; return -ENOSYS;
ret = ops->get_rate(clk); return ops->get_rate(clk);
if (ret)
return log_ret(ret);
return 0;
} }
struct clk *clk_get_parent(struct clk *clk) struct clk *clk_get_parent(struct clk *clk)