]> git.baikalelectronics.ru Git - uboot.git/commitdiff
clk: sci-clk: fix return value of set_rate
authorTero Kristo <t-kristo@ti.com>
Fri, 11 Jun 2021 08:45:10 +0000 (11:45 +0300)
committerLokesh Vutla <lokeshvutla@ti.com>
Fri, 11 Jun 2021 11:04:52 +0000 (16:34 +0530)
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>
drivers/clk/ti/clk-sci.c

index 6f0fdaa111c0243a03042b07eff327083edfd3ad..acb9eadf03c3148d202400488227f8b5efd124b1 100644 (file)
@@ -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)