clk: actions: owl-pll: convert from round_rate() to determine_rate()

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
Brian Masney 2025-08-11 11:19:06 -04:00
parent 670f7b2711
commit 234b301535
1 changed files with 16 additions and 9 deletions

View File

@ -56,8 +56,8 @@ static const struct clk_pll_table *_get_pll_table(
return table;
}
static long owl_pll_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate)
static int owl_pll_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct owl_pll *pll = hw_to_owl_pll(hw);
struct owl_pll_hw *pll_hw = &pll->pll_hw;
@ -65,17 +65,24 @@ static long owl_pll_round_rate(struct clk_hw *hw, unsigned long rate,
u32 mul;
if (pll_hw->table) {
clkt = _get_pll_table(pll_hw->table, rate);
return clkt->rate;
clkt = _get_pll_table(pll_hw->table, req->rate);
req->rate = clkt->rate;
return 0;
}
/* fixed frequency */
if (pll_hw->width == 0)
return pll_hw->bfreq;
if (pll_hw->width == 0) {
req->rate = pll_hw->bfreq;
mul = owl_pll_calculate_mul(pll_hw, rate);
return 0;
}
return pll_hw->bfreq * mul;
mul = owl_pll_calculate_mul(pll_hw, req->rate);
req->rate = pll_hw->bfreq * mul;
return 0;
}
static unsigned long owl_pll_recalc_rate(struct clk_hw *hw,
@ -188,7 +195,7 @@ const struct clk_ops owl_pll_ops = {
.enable = owl_pll_enable,
.disable = owl_pll_disable,
.is_enabled = owl_pll_is_enabled,
.round_rate = owl_pll_round_rate,
.determine_rate = owl_pll_determine_rate,
.recalc_rate = owl_pll_recalc_rate,
.set_rate = owl_pll_set_rate,
};