diff mbox series

[v2,2/2] clk: ingenic/TCU: Fix round_rate returning error

Message ID 20200213161952.37460-2-paul@crapouillou.net (mailing list archive)
State Accepted, archived
Headers show
Series [v2,1/2] clk: ingenic/jz4770: Exit with error if CGU init failed | expand

Commit Message

Paul Cercueil Feb. 13, 2020, 4:19 p.m. UTC
When requesting a rate superior to the parent's rate, it would return
-EINVAL instead of simply returning the parent's rate like it should.

Fixes: 4f89e4b8f121 ("clk: ingenic: Add driver for the TCU clocks")
Cc: stable@vger.kernel.org
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---

Notes:
    v2: New patch

 drivers/clk/ingenic/tcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Boyd March 21, 2020, 12:08 a.m. UTC | #1
Quoting Paul Cercueil (2020-02-13 08:19:52)
> When requesting a rate superior to the parent's rate, it would return
> -EINVAL instead of simply returning the parent's rate like it should.
> 
> Fixes: 4f89e4b8f121 ("clk: ingenic: Add driver for the TCU clocks")
> Cc: stable@vger.kernel.org
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---

Applied to clk-next
diff mbox series

Patch

diff --git a/drivers/clk/ingenic/tcu.c b/drivers/clk/ingenic/tcu.c
index ad7daa494fd4..cd537c3db782 100644
--- a/drivers/clk/ingenic/tcu.c
+++ b/drivers/clk/ingenic/tcu.c
@@ -189,7 +189,7 @@  static long ingenic_tcu_round_rate(struct clk_hw *hw, unsigned long req_rate,
 	u8 prescale;
 
 	if (req_rate > rate)
-		return -EINVAL;
+		return rate;
 
 	prescale = ingenic_tcu_get_prescale(rate, req_rate);