Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Brian Masney and committed by
Stephen Boyd
bf704662 c677a5a0

+15 -8
+15 -8
drivers/clk/imx/clk-pllv2.c
··· 178 178 return 0; 179 179 } 180 180 181 - static long clk_pllv2_round_rate(struct clk_hw *hw, unsigned long rate, 182 - unsigned long *prate) 181 + static int clk_pllv2_determine_rate(struct clk_hw *hw, 182 + struct clk_rate_request *req) 183 183 { 184 184 u32 dp_op, dp_mfd, dp_mfn; 185 185 int ret; 186 186 187 - ret = __clk_pllv2_set_rate(rate, *prate, &dp_op, &dp_mfd, &dp_mfn); 188 - if (ret) 189 - return ret; 187 + ret = __clk_pllv2_set_rate(req->rate, req->best_parent_rate, &dp_op, 188 + &dp_mfd, &dp_mfn); 189 + if (ret) { 190 + req->rate = ret; 190 191 191 - return __clk_pllv2_recalc_rate(*prate, MXC_PLL_DP_CTL_DPDCK0_2_EN, 192 - dp_op, dp_mfd, dp_mfn); 192 + return 0; 193 + } 194 + 195 + req->rate = __clk_pllv2_recalc_rate(req->best_parent_rate, 196 + MXC_PLL_DP_CTL_DPDCK0_2_EN, dp_op, 197 + dp_mfd, dp_mfn); 198 + 199 + return 0; 193 200 } 194 201 195 202 static int clk_pllv2_prepare(struct clk_hw *hw) ··· 242 235 .prepare = clk_pllv2_prepare, 243 236 .unprepare = clk_pllv2_unprepare, 244 237 .recalc_rate = clk_pllv2_recalc_rate, 245 - .round_rate = clk_pllv2_round_rate, 238 + .determine_rate = clk_pllv2_determine_rate, 246 239 .set_rate = clk_pllv2_set_rate, 247 240 }; 248 241