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

authored by

Brian Masney and committed by
Alexandre Belloni
ad853657 1251d043

+11 -6
+11 -6
drivers/rtc/rtc-pcf85063.c
··· 405 405 return clkout_rates[buf]; 406 406 } 407 407 408 - static long pcf85063_clkout_round_rate(struct clk_hw *hw, unsigned long rate, 409 - unsigned long *prate) 408 + static int pcf85063_clkout_determine_rate(struct clk_hw *hw, 409 + struct clk_rate_request *req) 410 410 { 411 411 int i; 412 412 413 413 for (i = 0; i < ARRAY_SIZE(clkout_rates); i++) 414 - if (clkout_rates[i] <= rate) 415 - return clkout_rates[i]; 414 + if (clkout_rates[i] <= req->rate) { 415 + req->rate = clkout_rates[i]; 416 416 417 - return clkout_rates[0]; 417 + return 0; 418 + } 419 + 420 + req->rate = clkout_rates[0]; 421 + 422 + return 0; 418 423 } 419 424 420 425 static int pcf85063_clkout_set_rate(struct clk_hw *hw, unsigned long rate, ··· 491 486 .unprepare = pcf85063_clkout_unprepare, 492 487 .is_prepared = pcf85063_clkout_is_prepared, 493 488 .recalc_rate = pcf85063_clkout_recalc_rate, 494 - .round_rate = pcf85063_clkout_round_rate, 489 + .determine_rate = pcf85063_clkout_determine_rate, 495 490 .set_rate = pcf85063_clkout_set_rate, 496 491 }; 497 492