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

authored by

Brian Masney and committed by
Alexandre Belloni
394a4b92 31b5fea3

+11 -6
+11 -6
drivers/rtc/rtc-hym8563.c
··· 285 285 return clkout_rates[ret]; 286 286 } 287 287 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) 290 290 { 291 291 int i; 292 292 293 293 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]; 296 296 297 - return clkout_rates[0]; 297 + return 0; 298 + } 299 + 300 + req->rate = clkout_rates[0]; 301 + 302 + return 0; 298 303 } 299 304 300 305 static int hym8563_clkout_set_rate(struct clk_hw *hw, unsigned long rate, ··· 368 363 .unprepare = hym8563_clkout_unprepare, 369 364 .is_prepared = hym8563_clkout_is_prepared, 370 365 .recalc_rate = hym8563_clkout_recalc_rate, 371 - .round_rate = hym8563_clkout_round_rate, 366 + .determine_rate = hym8563_clkout_determine_rate, 372 367 .set_rate = hym8563_clkout_set_rate, 373 368 }; 374 369