Skip to content

Commit 6534f1a

Browse files
masneybbebarino
authored andcommitted
clk: imx: fracn-gppll: 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]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent eb7a492 commit 6534f1a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

drivers/clk/imx/clk-fracn-gppll.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,25 @@ imx_get_pll_settings(struct clk_fracn_gppll *pll, unsigned long rate)
134134
return NULL;
135135
}
136136

137-
static long clk_fracn_gppll_round_rate(struct clk_hw *hw, unsigned long rate,
138-
unsigned long *prate)
137+
static int clk_fracn_gppll_determine_rate(struct clk_hw *hw,
138+
struct clk_rate_request *req)
139139
{
140140
struct clk_fracn_gppll *pll = to_clk_fracn_gppll(hw);
141141
const struct imx_fracn_gppll_rate_table *rate_table = pll->rate_table;
142142
int i;
143143

144144
/* Assuming rate_table is in descending order */
145145
for (i = 0; i < pll->rate_count; i++)
146-
if (rate >= rate_table[i].rate)
147-
return rate_table[i].rate;
146+
if (req->rate >= rate_table[i].rate) {
147+
req->rate = rate_table[i].rate;
148+
149+
return 0;
150+
}
148151

149152
/* return minimum supported value */
150-
return rate_table[pll->rate_count - 1].rate;
153+
req->rate = rate_table[pll->rate_count - 1].rate;
154+
155+
return 0;
151156
}
152157

153158
static unsigned long clk_fracn_gppll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
@@ -345,7 +350,7 @@ static const struct clk_ops clk_fracn_gppll_ops = {
345350
.unprepare = clk_fracn_gppll_unprepare,
346351
.is_prepared = clk_fracn_gppll_is_prepared,
347352
.recalc_rate = clk_fracn_gppll_recalc_rate,
348-
.round_rate = clk_fracn_gppll_round_rate,
353+
.determine_rate = clk_fracn_gppll_determine_rate,
349354
.set_rate = clk_fracn_gppll_set_rate,
350355
};
351356

0 commit comments

Comments
 (0)