diff mbox series

[PATCHv2,10/25] clk: sci-clk: fix return value of set_rate

Message ID 20201120112326.10350-11-t-kristo@ti.com
State New
Delegated to: Lokesh Vutla
Headers show
Series J72xx: HSM rearch support series | expand

Commit Message

Tero Kristo Nov. 20, 2020, 11:23 a.m. UTC
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>
 drivers/clk/clk-ti-sci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series


diff --git a/drivers/clk/clk-ti-sci.c b/drivers/clk/clk-ti-sci.c
index 7a9a645137..e2ad18e96b 100644
--- a/drivers/clk/clk-ti-sci.c
+++ b/drivers/clk/clk-ti-sci.c
@@ -111,10 +111,12 @@  static ulong ti_sci_clk_set_rate(struct clk *clk, ulong rate)
 	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)