Skip to content

Commit 7d85cd8

Browse files
masneybbebarino
authored andcommitted
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: e9f039c ("clk: microchip: core: convert from round_rate() to determine_rate()") Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 1624dea commit 7d85cd8

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

drivers/clk/microchip/clk-core.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -374,20 +374,6 @@ static unsigned long roclk_recalc_rate(struct clk_hw *hw,
374374
return roclk_calc_rate(parent_rate, rodiv, rotrim);
375375
}
376376

377-
static int roclk_determine_rate(struct clk_hw *hw,
378-
struct clk_rate_request *req)
379-
{
380-
u32 rotrim, rodiv;
381-
382-
/* calculate dividers for new rate */
383-
roclk_calc_div_trim(req->rate, req->best_parent_rate, &rodiv, &rotrim);
384-
385-
/* caclulate new rate (rounding) based on new rodiv & rotrim */
386-
req->rate = roclk_calc_rate(req->best_parent_rate, rodiv, rotrim);
387-
388-
return 0;
389-
}
390-
391377
static int roclk_determine_rate(struct clk_hw *hw,
392378
struct clk_rate_request *req)
393379
{
@@ -398,6 +384,8 @@ static int roclk_determine_rate(struct clk_hw *hw,
398384

399385
/* find a parent which can generate nearest clkrate >= rate */
400386
for (i = 0; i < clk_hw_get_num_parents(hw); i++) {
387+
u32 rotrim, rodiv;
388+
401389
/* get parent */
402390
parent_clk = clk_hw_get_parent_by_index(hw, i);
403391
if (!parent_clk)
@@ -408,7 +396,12 @@ static int roclk_determine_rate(struct clk_hw *hw,
408396
if (req->rate > parent_rate)
409397
continue;
410398

411-
nearest_rate = roclk_round_rate(hw, req->rate, &parent_rate);
399+
/* calculate dividers for new rate */
400+
roclk_calc_div_trim(req->rate, req->best_parent_rate, &rodiv, &rotrim);
401+
402+
/* caclulate new rate (rounding) based on new rodiv & rotrim */
403+
nearest_rate = roclk_calc_rate(req->best_parent_rate, rodiv, rotrim);
404+
412405
delta = abs(nearest_rate - req->rate);
413406
if ((nearest_rate >= req->rate) && (delta < best_delta)) {
414407
best_parent_clk = parent_clk;

0 commit comments

Comments
 (0)