Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rtc: rv3028: 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 <bmasney@redhat.com>
Link: https://lore.kernel.org/r/20250710-rtc-clk-round-rate-v1-14-33140bb2278e@redhat.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Brian Masney and committed by
Alexandre Belloni
c4253b09 e6f1af71

+11 -6
+11 -6
drivers/rtc/rtc-rv3028.c
··· 731 731 return clkout_rates[clkout]; 732 732 } 733 733 734 - static long rv3028_clkout_round_rate(struct clk_hw *hw, unsigned long rate, 735 - unsigned long *prate) 734 + static int rv3028_clkout_determine_rate(struct clk_hw *hw, 735 + struct clk_rate_request *req) 736 736 { 737 737 int i; 738 738 739 739 for (i = 0; i < ARRAY_SIZE(clkout_rates); i++) 740 - if (clkout_rates[i] <= rate) 741 - return clkout_rates[i]; 740 + if (clkout_rates[i] <= req->rate) { 741 + req->rate = clkout_rates[i]; 742 742 743 - return clkout_rates[0]; 743 + return 0; 744 + } 745 + 746 + req->rate = clkout_rates[0]; 747 + 748 + return 0; 744 749 } 745 750 746 751 static int rv3028_clkout_set_rate(struct clk_hw *hw, unsigned long rate, ··· 807 802 .unprepare = rv3028_clkout_unprepare, 808 803 .is_prepared = rv3028_clkout_is_prepared, 809 804 .recalc_rate = rv3028_clkout_recalc_rate, 810 - .round_rate = rv3028_clkout_round_rate, 805 + .determine_rate = rv3028_clkout_determine_rate, 811 806 .set_rate = rv3028_clkout_set_rate, 812 807 }; 813 808