diff mbox

clk: renesas: rcar-gen3: Fix error return code in cpg_sd_clock_recalc_rate

Message ID 20170713210656.31911-1-wsa+renesas@sang-engineering.com (mailing list archive)
State Superseded
Headers show

Commit Message

Wolfram Sang July 13, 2017, 9:06 p.m. UTC
From: Takeshi Kihara <takeshi.kihara.df@renesas.com>

In .recalc_rate of struct clk_ops, it is desirable to return 0 if an
error occurs, but -EINVAL is returned. This patch fixes it.

Fixes: 5b1defde7054 ("clk: renesas: cpg-mssr: Extract common R-Car Gen3 support code")
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Totally valid patch forwarded from BSP.

 drivers/clk/renesas/rcar-gen3-cpg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wolfram Sang July 14, 2017, 2:23 p.m. UTC | #1
On Thu, Jul 13, 2017 at 11:06:56PM +0200, Wolfram Sang wrote:
> From: Takeshi Kihara <takeshi.kihara.df@renesas.com>
> 
> In .recalc_rate of struct clk_ops, it is desirable to return 0 if an
> error occurs, but -EINVAL is returned. This patch fixes it.
> 
> Fixes: 5b1defde7054 ("clk: renesas: cpg-mssr: Extract common R-Car Gen3 support code")
> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

I just saw that Kaneko-san posted this patch as well:

https://patchwork.kernel.org/patch/9688509/

Please pick his patch, I'll add my Rev-by there.
diff mbox

Patch

diff --git a/drivers/clk/renesas/rcar-gen3-cpg.c b/drivers/clk/renesas/rcar-gen3-cpg.c
index 3dee900522b703..e7371a8c4eb701 100644
--- a/drivers/clk/renesas/rcar-gen3-cpg.c
+++ b/drivers/clk/renesas/rcar-gen3-cpg.c
@@ -147,7 +147,7 @@  static unsigned long cpg_sd_clock_recalc_rate(struct clk_hw *hw,
 			break;
 
 	if (i >= clock->div_num)
-		return -EINVAL;
+		return 0;
 
 	return DIV_ROUND_CLOSEST(rate, clock->div_table[i].div);
 }