From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tero Kristo Date: Wed, 5 May 2021 20:55:23 +0300 Subject: [PATCHv3 09/26] clk: sci-clk: fix return value of set_rate In-Reply-To: <20210505175540.15006-1-kristo@kernel.org> References: <20210505175540.15006-1-kristo@kernel.org> Message-ID: <20210505175540.15006-10-kristo@kernel.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Tero Kristo 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 Signed-off-by: Tero Kristo --- drivers/clk/ti/clk-sci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/ti/clk-sci.c b/drivers/clk/ti/clk-sci.c index 6f0fdaa111..acb9eadf03 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) -- 2.17.1