aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/ingenic
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2020-02-13 13:19:52 -0300
committerStephen Boyd <sboyd@kernel.org>2020-03-20 17:08:40 -0700
commitedcc42945dee85e9dec3737f3dbf59d917ae5418 (patch)
tree062435904793588663dbc8318ade126b5858ee23 /drivers/clk/ingenic
parentclk: ingenic/jz4770: Exit with error if CGU init failed (diff)
downloadlinux-dev-edcc42945dee85e9dec3737f3dbf59d917ae5418.tar.xz
linux-dev-edcc42945dee85e9dec3737f3dbf59d917ae5418.zip
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 <paul@crapouillou.net> Link: https://lkml.kernel.org/r/20200213161952.37460-2-paul@crapouillou.net Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/ingenic')
-rw-r--r--drivers/clk/ingenic/tcu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/ingenic/tcu.c b/drivers/clk/ingenic/tcu.c
index 879990762f57..153a954b0d2f 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);