diff options
author | Tero Kristo <t-kristo@ti.com> | 2021-06-11 11:45:10 +0300 |
---|---|---|
committer | Lokesh Vutla <lokeshvutla@ti.com> | 2021-06-11 16:34:52 +0530 |
commit | c319572abd95826b958c753ebcd3b83884eb60af (patch) | |
tree | ed66a23cc7da34d7e8ac35f455d2a7883e63b681 /drivers/clk | |
parent | 7ab418fbe61275efb5c89cff48bbdd299eb1a22e (diff) | |
download | u-boot-c319572abd95826b958c753ebcd3b83884eb60af.tar.gz |
clk: sci-clk: fix return value of set_rate
Set rate should return the new clock rate on success, and negative error
value on failure. Fix this, as currently set_rate returns 0 on success.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/ti/clk-sci.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/clk/ti/clk-sci.c b/drivers/clk/ti/clk-sci.c index 6f0fdaa111c..acb9eadf03c 100644 --- a/drivers/clk/ti/clk-sci.c +++ b/drivers/clk/ti/clk-sci.c @@ -111,10 +111,12 @@ static ulong ti_sci_clk_set_rate(struct clk *clk, ulong rate) #endif ret = cops->set_freq(sci, clk->id, clk->data, 0, rate, ULONG_MAX); - if (ret) + if (ret) { dev_err(clk->dev, "%s: set_freq failed (%d)\n", __func__, ret); + return ret; + } - return ret; + return rate; } static int ti_sci_clk_set_parent(struct clk *clk, struct clk *parent) |