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

clk: qcom: spmi-pmic-div: 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>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250703-clk-cocci-drop-round-rate-v1-6-3a8da898367e@redhat.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Brian Masney and committed by
Bjorn Andersson
ebec0477 11add210

+7 -5
+7 -5
drivers/clk/qcom/clk-spmi-pmic-div.c
··· 112 112 spin_unlock_irqrestore(&clkdiv->lock, flags); 113 113 } 114 114 115 - static long clk_spmi_pmic_div_round_rate(struct clk_hw *hw, unsigned long rate, 116 - unsigned long *parent_rate) 115 + static int clk_spmi_pmic_div_determine_rate(struct clk_hw *hw, 116 + struct clk_rate_request *req) 117 117 { 118 118 unsigned int div, div_factor; 119 119 120 - div = DIV_ROUND_UP(*parent_rate, rate); 120 + div = DIV_ROUND_UP(req->best_parent_rate, req->rate); 121 121 div_factor = div_to_div_factor(div); 122 122 div = div_factor_to_div(div_factor); 123 123 124 - return *parent_rate / div; 124 + req->rate = req->best_parent_rate / div; 125 + 126 + return 0; 125 127 } 126 128 127 129 static unsigned long ··· 171 169 .disable = clk_spmi_pmic_div_disable, 172 170 .set_rate = clk_spmi_pmic_div_set_rate, 173 171 .recalc_rate = clk_spmi_pmic_div_recalc_rate, 174 - .round_rate = clk_spmi_pmic_div_round_rate, 172 + .determine_rate = clk_spmi_pmic_div_determine_rate, 175 173 }; 176 174 177 175 struct spmi_pmic_div_clk_cc {