mirror of
https://github.com/torvalds/linux.git
synced 2026-01-12 00:42:35 +08:00
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>
This commit is contained in:
committed by
Bjorn Andersson
parent
11add2107c
commit
ebec04773b
@@ -112,16 +112,18 @@ static void clk_spmi_pmic_div_disable(struct clk_hw *hw)
|
||||
spin_unlock_irqrestore(&clkdiv->lock, flags);
|
||||
}
|
||||
|
||||
static long clk_spmi_pmic_div_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *parent_rate)
|
||||
static int clk_spmi_pmic_div_determine_rate(struct clk_hw *hw,
|
||||
struct clk_rate_request *req)
|
||||
{
|
||||
unsigned int div, div_factor;
|
||||
|
||||
div = DIV_ROUND_UP(*parent_rate, rate);
|
||||
div = DIV_ROUND_UP(req->best_parent_rate, req->rate);
|
||||
div_factor = div_to_div_factor(div);
|
||||
div = div_factor_to_div(div_factor);
|
||||
|
||||
return *parent_rate / div;
|
||||
req->rate = req->best_parent_rate / div;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
@@ -169,7 +171,7 @@ static const struct clk_ops clk_spmi_pmic_div_ops = {
|
||||
.disable = clk_spmi_pmic_div_disable,
|
||||
.set_rate = clk_spmi_pmic_div_set_rate,
|
||||
.recalc_rate = clk_spmi_pmic_div_recalc_rate,
|
||||
.round_rate = clk_spmi_pmic_div_round_rate,
|
||||
.determine_rate = clk_spmi_pmic_div_determine_rate,
|
||||
};
|
||||
|
||||
struct spmi_pmic_div_clk_cc {
|
||||
|
||||
Reference in New Issue
Block a user