From: Tero Kristo Date: Fri, 11 Jun 2021 08:45:10 +0000 (+0300) Subject: clk: sci-clk: fix return value of set_rate X-Git-Tag: v2025.01-rc5-pxa1908~1819^2~12^2~24 X-Git-Url: http://git.dujemihanovic.xyz/html/index.html?a=commitdiff_plain;h=c319572abd95826b958c753ebcd3b83884eb60af;p=u-boot.git 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 Signed-off-by: Tero Kristo --- 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)