Skip to content

Commit c4253b0

Browse files
masneybalexandrebelloni
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent e6f1af7 commit c4253b0

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

drivers/rtc/rtc-rv3028.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -731,16 +731,21 @@ static unsigned long rv3028_clkout_recalc_rate(struct clk_hw *hw,
731731
return clkout_rates[clkout];
732732
}
733733

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)
736736
{
737737
int i;
738738

739739
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];
742742

743-
return clkout_rates[0];
743+
return 0;
744+
}
745+
746+
req->rate = clkout_rates[0];
747+
748+
return 0;
744749
}
745750

746751
static int rv3028_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -802,7 +807,7 @@ static const struct clk_ops rv3028_clkout_ops = {
802807
.unprepare = rv3028_clkout_unprepare,
803808
.is_prepared = rv3028_clkout_is_prepared,
804809
.recalc_rate = rv3028_clkout_recalc_rate,
805-
.round_rate = rv3028_clkout_round_rate,
810+
.determine_rate = rv3028_clkout_determine_rate,
806811
.set_rate = rv3028_clkout_set_rate,
807812
};
808813

0 commit comments

Comments
 (0)