Skip to content

Commit bf70466

Browse files
masneybbebarino
authored andcommitted
clk: imx: pllv2: 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 c677a5a commit bf70466

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

drivers/clk/imx/clk-pllv2.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,25 @@ static int clk_pllv2_set_rate(struct clk_hw *hw, unsigned long rate,
178178
return 0;
179179
}
180180

181-
static long clk_pllv2_round_rate(struct clk_hw *hw, unsigned long rate,
182-
unsigned long *prate)
181+
static int clk_pllv2_determine_rate(struct clk_hw *hw,
182+
struct clk_rate_request *req)
183183
{
184184
u32 dp_op, dp_mfd, dp_mfn;
185185
int ret;
186186

187-
ret = __clk_pllv2_set_rate(rate, *prate, &dp_op, &dp_mfd, &dp_mfn);
188-
if (ret)
189-
return ret;
187+
ret = __clk_pllv2_set_rate(req->rate, req->best_parent_rate, &dp_op,
188+
&dp_mfd, &dp_mfn);
189+
if (ret) {
190+
req->rate = ret;
190191

191-
return __clk_pllv2_recalc_rate(*prate, MXC_PLL_DP_CTL_DPDCK0_2_EN,
192-
dp_op, dp_mfd, dp_mfn);
192+
return 0;
193+
}
194+
195+
req->rate = __clk_pllv2_recalc_rate(req->best_parent_rate,
196+
MXC_PLL_DP_CTL_DPDCK0_2_EN, dp_op,
197+
dp_mfd, dp_mfn);
198+
199+
return 0;
193200
}
194201

195202
static int clk_pllv2_prepare(struct clk_hw *hw)
@@ -235,7 +242,7 @@ static const struct clk_ops clk_pllv2_ops = {
235242
.prepare = clk_pllv2_prepare,
236243
.unprepare = clk_pllv2_unprepare,
237244
.recalc_rate = clk_pllv2_recalc_rate,
238-
.round_rate = clk_pllv2_round_rate,
245+
.determine_rate = clk_pllv2_determine_rate,
239246
.set_rate = clk_pllv2_set_rate,
240247
};
241248

0 commit comments

Comments
 (0)