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: nct3018y: 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-11-33140bb2278e@redhat.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Brian Masney and committed by
Alexandre Belloni
1251d043 9e0dfc79

+11 -6
+11 -6
drivers/rtc/rtc-nct3018y.c
··· 367 367 return clkout_rates[flags]; 368 368 } 369 369 370 - static long nct3018y_clkout_round_rate(struct clk_hw *hw, unsigned long rate, 371 - unsigned long *prate) 370 + static int nct3018y_clkout_determine_rate(struct clk_hw *hw, 371 + struct clk_rate_request *req) 372 372 { 373 373 int i; 374 374 375 375 for (i = 0; i < ARRAY_SIZE(clkout_rates); i++) 376 - if (clkout_rates[i] <= rate) 377 - return clkout_rates[i]; 376 + if (clkout_rates[i] <= req->rate) { 377 + req->rate = clkout_rates[i]; 378 378 379 - return clkout_rates[0]; 379 + return 0; 380 + } 381 + 382 + req->rate = clkout_rates[0]; 383 + 384 + return 0; 380 385 } 381 386 382 387 static int nct3018y_clkout_set_rate(struct clk_hw *hw, unsigned long rate, ··· 451 446 .unprepare = nct3018y_clkout_unprepare, 452 447 .is_prepared = nct3018y_clkout_is_prepared, 453 448 .recalc_rate = nct3018y_clkout_recalc_rate, 454 - .round_rate = nct3018y_clkout_round_rate, 449 + .determine_rate = nct3018y_clkout_determine_rate, 455 450 .set_rate = nct3018y_clkout_set_rate, 456 451 }; 457 452