mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 04:23:35 +02:00
clk: imx: pllv2: 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> Link: https://lore.kernel.org/r/20250710-clk-imx-round-rate-v1-10-5726f98e6d8d@redhat.com Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
c677a5a0ee
commit
bf70466209
|
|
@ -178,18 +178,25 @@ static int clk_pllv2_set_rate(struct clk_hw *hw, unsigned long rate,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static long clk_pllv2_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *prate)
|
||||
static int clk_pllv2_determine_rate(struct clk_hw *hw,
|
||||
struct clk_rate_request *req)
|
||||
{
|
||||
u32 dp_op, dp_mfd, dp_mfn;
|
||||
int ret;
|
||||
|
||||
ret = __clk_pllv2_set_rate(rate, *prate, &dp_op, &dp_mfd, &dp_mfn);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = __clk_pllv2_set_rate(req->rate, req->best_parent_rate, &dp_op,
|
||||
&dp_mfd, &dp_mfn);
|
||||
if (ret) {
|
||||
req->rate = ret;
|
||||
|
||||
return __clk_pllv2_recalc_rate(*prate, MXC_PLL_DP_CTL_DPDCK0_2_EN,
|
||||
dp_op, dp_mfd, dp_mfn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
req->rate = __clk_pllv2_recalc_rate(req->best_parent_rate,
|
||||
MXC_PLL_DP_CTL_DPDCK0_2_EN, dp_op,
|
||||
dp_mfd, dp_mfn);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int clk_pllv2_prepare(struct clk_hw *hw)
|
||||
|
|
@ -235,7 +242,7 @@ static const struct clk_ops clk_pllv2_ops = {
|
|||
.prepare = clk_pllv2_prepare,
|
||||
.unprepare = clk_pllv2_unprepare,
|
||||
.recalc_rate = clk_pllv2_recalc_rate,
|
||||
.round_rate = clk_pllv2_round_rate,
|
||||
.determine_rate = clk_pllv2_determine_rate,
|
||||
.set_rate = clk_pllv2_set_rate,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user