From: Paul Cercueil Date: Thu, 13 Feb 2020 16:19:52 +0000 (-0300) Subject: clk: ingenic/TCU: Fix round_rate returning error X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=edcc42945dee85e9dec3737f3dbf59d917ae5418;p=linux.git clk: ingenic/TCU: Fix round_rate returning error 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 Link: https://lkml.kernel.org/r/20200213161952.37460-2-paul@crapouillou.net Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/ingenic/tcu.c b/drivers/clk/ingenic/tcu.c index 879990762f57c..153a954b0d2fd 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);