clk: spear: vco-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:36 -04:00
parent 2767256c6f
commit f32c0f8b90

View File

@@ -110,12 +110,15 @@ static long clk_pll_round_rate_index(struct clk_hw *hw, unsigned long drate,
return rate;
}
static long clk_pll_round_rate(struct clk_hw *hw, unsigned long drate,
unsigned long *prate)
static int clk_pll_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
int unused;
return clk_pll_round_rate_index(hw, drate, prate, &unused);
req->rate = clk_pll_round_rate_index(hw, req->rate,
&req->best_parent_rate, &unused);
return 0;
}
static unsigned long clk_pll_recalc_rate(struct clk_hw *hw, unsigned long
@@ -164,7 +167,7 @@ static int clk_pll_set_rate(struct clk_hw *hw, unsigned long drate,
static const struct clk_ops clk_pll_ops = {
.recalc_rate = clk_pll_recalc_rate,
.round_rate = clk_pll_round_rate,
.determine_rate = clk_pll_determine_rate,
.set_rate = clk_pll_set_rate,
};
@@ -176,14 +179,16 @@ static inline unsigned long vco_calc_rate(struct clk_hw *hw,
return pll_calc_rate(vco->rtbl, prate, index, NULL);
}
static long clk_vco_round_rate(struct clk_hw *hw, unsigned long drate,
unsigned long *prate)
static int clk_vco_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct clk_vco *vco = to_clk_vco(hw);
int unused;
return clk_round_rate_index(hw, drate, *prate, vco_calc_rate,
vco->rtbl_cnt, &unused);
req->rate = clk_round_rate_index(hw, req->rate, req->best_parent_rate,
vco_calc_rate, vco->rtbl_cnt, &unused);
return 0;
}
static unsigned long clk_vco_recalc_rate(struct clk_hw *hw,
@@ -265,7 +270,7 @@ static int clk_vco_set_rate(struct clk_hw *hw, unsigned long drate,
static const struct clk_ops clk_vco_ops = {
.recalc_rate = clk_vco_recalc_rate,
.round_rate = clk_vco_round_rate,
.determine_rate = clk_vco_determine_rate,
.set_rate = clk_vco_set_rate,
};