Skip to content

Commit ad85365

Browse files
masneybalexandrebelloni
authored andcommitted
rtc: pcf85063: 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 1251d04 commit ad85365

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

drivers/rtc/rtc-pcf85063.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,16 +405,21 @@ static unsigned long pcf85063_clkout_recalc_rate(struct clk_hw *hw,
405405
return clkout_rates[buf];
406406
}
407407

408-
static long pcf85063_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
409-
unsigned long *prate)
408+
static int pcf85063_clkout_determine_rate(struct clk_hw *hw,
409+
struct clk_rate_request *req)
410410
{
411411
int i;
412412

413413
for (i = 0; i < ARRAY_SIZE(clkout_rates); i++)
414-
if (clkout_rates[i] <= rate)
415-
return clkout_rates[i];
414+
if (clkout_rates[i] <= req->rate) {
415+
req->rate = clkout_rates[i];
416416

417-
return clkout_rates[0];
417+
return 0;
418+
}
419+
420+
req->rate = clkout_rates[0];
421+
422+
return 0;
418423
}
419424

420425
static int pcf85063_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -486,7 +491,7 @@ static const struct clk_ops pcf85063_clkout_ops = {
486491
.unprepare = pcf85063_clkout_unprepare,
487492
.is_prepared = pcf85063_clkout_is_prepared,
488493
.recalc_rate = pcf85063_clkout_recalc_rate,
489-
.round_rate = pcf85063_clkout_round_rate,
494+
.determine_rate = pcf85063_clkout_determine_rate,
490495
.set_rate = pcf85063_clkout_set_rate,
491496
};
492497

0 commit comments

Comments
 (0)