Skip to content

Commit ebec047

Browse files
masneybandersson
authored andcommitted
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>
1 parent 11add21 commit ebec047

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

drivers/clk/qcom/clk-spmi-pmic-div.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,18 @@ static void clk_spmi_pmic_div_disable(struct clk_hw *hw)
112112
spin_unlock_irqrestore(&clkdiv->lock, flags);
113113
}
114114

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)
117117
{
118118
unsigned int div, div_factor;
119119

120-
div = DIV_ROUND_UP(*parent_rate, rate);
120+
div = DIV_ROUND_UP(req->best_parent_rate, req->rate);
121121
div_factor = div_to_div_factor(div);
122122
div = div_factor_to_div(div_factor);
123123

124-
return *parent_rate / div;
124+
req->rate = req->best_parent_rate / div;
125+
126+
return 0;
125127
}
126128

127129
static unsigned long
@@ -169,7 +171,7 @@ static const struct clk_ops clk_spmi_pmic_div_ops = {
169171
.disable = clk_spmi_pmic_div_disable,
170172
.set_rate = clk_spmi_pmic_div_set_rate,
171173
.recalc_rate = clk_spmi_pmic_div_recalc_rate,
172-
.round_rate = clk_spmi_pmic_div_round_rate,
174+
.determine_rate = clk_spmi_pmic_div_determine_rate,
173175
};
174176

175177
struct spmi_pmic_div_clk_cc {

0 commit comments

Comments
 (0)