Skip to content

Commit e6f1af7

Browse files
masneybalexandrebelloni
authored andcommitted
rtc: pcf8563: 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] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent ad85365 commit e6f1af7

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

drivers/rtc/rtc-pcf8563.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,21 @@ static unsigned long pcf8563_clkout_recalc_rate(struct clk_hw *hw,
330330
return clkout_rates[buf];
331331
}
332332

333-
static long pcf8563_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
334-
unsigned long *prate)
333+
static int pcf8563_clkout_determine_rate(struct clk_hw *hw,
334+
struct clk_rate_request *req)
335335
{
336336
int i;
337337

338338
for (i = 0; i < ARRAY_SIZE(clkout_rates); i++)
339-
if (clkout_rates[i] <= rate)
340-
return clkout_rates[i];
339+
if (clkout_rates[i] <= req->rate) {
340+
req->rate = clkout_rates[i];
341341

342-
return clkout_rates[0];
342+
return 0;
343+
}
344+
345+
req->rate = clkout_rates[0];
346+
347+
return 0;
343348
}
344349

345350
static int pcf8563_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -413,7 +418,7 @@ static const struct clk_ops pcf8563_clkout_ops = {
413418
.unprepare = pcf8563_clkout_unprepare,
414419
.is_prepared = pcf8563_clkout_is_prepared,
415420
.recalc_rate = pcf8563_clkout_recalc_rate,
416-
.round_rate = pcf8563_clkout_round_rate,
421+
.determine_rate = pcf8563_clkout_determine_rate,
417422
.set_rate = pcf8563_clkout_set_rate,
418423
};
419424

0 commit comments

Comments
 (0)