diff options
| author | Brian Masney <bmasney@redhat.com> | 2025-09-27 20:34:34 -0400 |
|---|---|---|
| committer | Stephen Boyd <sboyd@kernel.org> | 2025-09-30 21:54:29 -0700 |
| commit | 7d85cd8730ab7701a1cafd0db0d7b6b1f6cfbb91 (patch) | |
| tree | c67a5cf80325db11bef641a145db4563729a82f9 | |
| parent | 1624dead9a4d288a594fdf19735ebfe4bb567cb8 (diff) | |
clk: microchip: core: remove duplicate roclk_determine_rate()
Fix compiler error caused by the round_rate() to determine_rate()
migration.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509280327.jsapR0Ww-lkp@intel.com/
Signed-off-by: Brian Masney <bmasney@redhat.com>
Fixes: e9f039c08cdc ("clk: microchip: core: convert from round_rate() to determine_rate()")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
| -rw-r--r-- | drivers/clk/microchip/clk-core.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c index 3e03e10539c7..b34348d491f3 100644 --- a/drivers/clk/microchip/clk-core.c +++ b/drivers/clk/microchip/clk-core.c @@ -377,20 +377,6 @@ static unsigned long roclk_recalc_rate(struct clk_hw *hw, static int roclk_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) { - u32 rotrim, rodiv; - - /* calculate dividers for new rate */ - roclk_calc_div_trim(req->rate, req->best_parent_rate, &rodiv, &rotrim); - - /* caclulate new rate (rounding) based on new rodiv & rotrim */ - req->rate = roclk_calc_rate(req->best_parent_rate, rodiv, rotrim); - - return 0; -} - -static int roclk_determine_rate(struct clk_hw *hw, - struct clk_rate_request *req) -{ struct clk_hw *parent_clk, *best_parent_clk = NULL; unsigned int i, delta, best_delta = -1; unsigned long parent_rate, best_parent_rate = 0; @@ -398,6 +384,8 @@ static int roclk_determine_rate(struct clk_hw *hw, /* find a parent which can generate nearest clkrate >= rate */ for (i = 0; i < clk_hw_get_num_parents(hw); i++) { + u32 rotrim, rodiv; + /* get parent */ parent_clk = clk_hw_get_parent_by_index(hw, i); if (!parent_clk) @@ -408,7 +396,12 @@ static int roclk_determine_rate(struct clk_hw *hw, if (req->rate > parent_rate) continue; - nearest_rate = roclk_round_rate(hw, req->rate, &parent_rate); + /* calculate dividers for new rate */ + roclk_calc_div_trim(req->rate, req->best_parent_rate, &rodiv, &rotrim); + + /* caclulate new rate (rounding) based on new rodiv & rotrim */ + nearest_rate = roclk_calc_rate(req->best_parent_rate, rodiv, rotrim); + delta = abs(nearest_rate - req->rate); if ((nearest_rate >= req->rate) && (delta < best_delta)) { best_parent_clk = parent_clk; |
