Skip to content

Commit 2b0d4f1

Browse files
masneybwens
authored andcommitted
clk: sunxi-ng: ccu_nk: 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 <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Chen-Yu Tsai <[email protected]>
1 parent ee9c15c commit 2b0d4f1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/clk/sunxi-ng/ccu_nk.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,26 +92,26 @@ static unsigned long ccu_nk_recalc_rate(struct clk_hw *hw,
9292
return rate;
9393
}
9494

95-
static long ccu_nk_round_rate(struct clk_hw *hw, unsigned long rate,
96-
unsigned long *parent_rate)
95+
static int ccu_nk_determine_rate(struct clk_hw *hw,
96+
struct clk_rate_request *req)
9797
{
9898
struct ccu_nk *nk = hw_to_ccu_nk(hw);
9999
struct _ccu_nk _nk;
100100

101101
if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV)
102-
rate *= nk->fixed_post_div;
102+
req->rate *= nk->fixed_post_div;
103103

104104
_nk.min_n = nk->n.min ?: 1;
105105
_nk.max_n = nk->n.max ?: 1 << nk->n.width;
106106
_nk.min_k = nk->k.min ?: 1;
107107
_nk.max_k = nk->k.max ?: 1 << nk->k.width;
108108

109-
rate = ccu_nk_find_best(*parent_rate, rate, &_nk);
109+
req->rate = ccu_nk_find_best(req->best_parent_rate, req->rate, &_nk);
110110

111111
if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV)
112-
rate = rate / nk->fixed_post_div;
112+
req->rate = req->rate / nk->fixed_post_div;
113113

114-
return rate;
114+
return 0;
115115
}
116116

117117
static int ccu_nk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -155,7 +155,7 @@ const struct clk_ops ccu_nk_ops = {
155155
.is_enabled = ccu_nk_is_enabled,
156156

157157
.recalc_rate = ccu_nk_recalc_rate,
158-
.round_rate = ccu_nk_round_rate,
158+
.determine_rate = ccu_nk_determine_rate,
159159
.set_rate = ccu_nk_set_rate,
160160
};
161161
EXPORT_SYMBOL_NS_GPL(ccu_nk_ops, "SUNXI_CCU");

0 commit comments

Comments
 (0)