Skip to content

Commit 394a4b9

Browse files
masneybalexandrebelloni
authored andcommitted
rtc: hym8563: 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 31b5fea commit 394a4b9

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

drivers/rtc/rtc-hym8563.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,21 @@ static unsigned long hym8563_clkout_recalc_rate(struct clk_hw *hw,
285285
return clkout_rates[ret];
286286
}
287287

288-
static long hym8563_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
289-
unsigned long *prate)
288+
static int hym8563_clkout_determine_rate(struct clk_hw *hw,
289+
struct clk_rate_request *req)
290290
{
291291
int i;
292292

293293
for (i = 0; i < ARRAY_SIZE(clkout_rates); i++)
294-
if (clkout_rates[i] <= rate)
295-
return clkout_rates[i];
294+
if (clkout_rates[i] <= req->rate) {
295+
req->rate = clkout_rates[i];
296296

297-
return clkout_rates[0];
297+
return 0;
298+
}
299+
300+
req->rate = clkout_rates[0];
301+
302+
return 0;
298303
}
299304

300305
static int hym8563_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -363,7 +368,7 @@ static const struct clk_ops hym8563_clkout_ops = {
363368
.unprepare = hym8563_clkout_unprepare,
364369
.is_prepared = hym8563_clkout_is_prepared,
365370
.recalc_rate = hym8563_clkout_recalc_rate,
366-
.round_rate = hym8563_clkout_round_rate,
371+
.determine_rate = hym8563_clkout_determine_rate,
367372
.set_rate = hym8563_clkout_set_rate,
368373
};
369374

0 commit comments

Comments
 (0)