Skip to content

Commit 9e0dfc7

Browse files
masneybalexandrebelloni
authored andcommitted
rtc: max31335: 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 e05d81b commit 9e0dfc7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/rtc/rtc-max31335.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,15 +497,17 @@ static unsigned long max31335_clkout_recalc_rate(struct clk_hw *hw,
497497
return max31335_clkout_freq[reg & freq_mask];
498498
}
499499

500-
static long max31335_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
501-
unsigned long *prate)
500+
static int max31335_clkout_determine_rate(struct clk_hw *hw,
501+
struct clk_rate_request *req)
502502
{
503503
int index;
504504

505-
index = find_closest(rate, max31335_clkout_freq,
505+
index = find_closest(req->rate, max31335_clkout_freq,
506506
ARRAY_SIZE(max31335_clkout_freq));
507507

508-
return max31335_clkout_freq[index];
508+
req->rate = max31335_clkout_freq[index];
509+
510+
return 0;
509511
}
510512

511513
static int max31335_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -554,7 +556,7 @@ static int max31335_clkout_is_enabled(struct clk_hw *hw)
554556

555557
static const struct clk_ops max31335_clkout_ops = {
556558
.recalc_rate = max31335_clkout_recalc_rate,
557-
.round_rate = max31335_clkout_round_rate,
559+
.determine_rate = max31335_clkout_determine_rate,
558560
.set_rate = max31335_clkout_set_rate,
559561
.enable = max31335_clkout_enable,
560562
.disable = max31335_clkout_disable,

0 commit comments

Comments
 (0)