]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
clk: spacemit: ccu_pll: fix error return value in recalc_rate callback
authorAkhilesh Patil <akhilesh@ee.iitb.ac.in>
Wed, 23 Jul 2025 05:29:56 +0000 (10:59 +0530)
committerStephen Boyd <sboyd@kernel.org>
Fri, 25 Jul 2025 02:36:15 +0000 (19:36 -0700)
Return 0 instead of -EINVAL if function ccu_pll_recalc_rate() fails to
get correct rate entry. Follow .recalc_rate callback documentation
as mentioned in include/linux/clk-provider.h for error return value.

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
Fixes: 1b72c59db0add ("clk: spacemit: Add clock support for SpacemiT K1 SoC")
Reviewed-by: Haylen Chu <heylenay@4d2.org>
Reviewed-by: Alex Elder <elder@riscstar.com>
Link: https://lore.kernel.org/r/aIBzVClNQOBrjIFG@bhairav-test.ee.iitb.ac.in
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/spacemit/ccu_pll.c

index 4427dcfbbb97f30ac5e7bb9889dc630e8d5600ec..45f540073a656c0edc341a903acc3f2405971fc9 100644 (file)
@@ -122,7 +122,7 @@ static unsigned long ccu_pll_recalc_rate(struct clk_hw *hw,
 
        WARN_ON_ONCE(!entry);
 
-       return entry ? entry->rate : -EINVAL;
+       return entry ? entry->rate : 0;
 }
 
 static long ccu_pll_round_rate(struct clk_hw *hw, unsigned long rate,