mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 12:56:00 +01:00
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:
parent
221c48b423
commit
bae28dd7f7
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user