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

authored by

Brian Masney and committed by
Alexandre Belloni
e6f1af71 ad853657

+11 -6
+11 -6
drivers/rtc/rtc-pcf8563.c
··· 330 330 return clkout_rates[buf]; 331 331 } 332 332 333 - static long pcf8563_clkout_round_rate(struct clk_hw *hw, unsigned long rate, 334 - unsigned long *prate) 333 + static int pcf8563_clkout_determine_rate(struct clk_hw *hw, 334 + struct clk_rate_request *req) 335 335 { 336 336 int i; 337 337 338 338 for (i = 0; i < ARRAY_SIZE(clkout_rates); i++) 339 - if (clkout_rates[i] <= rate) 340 - return clkout_rates[i]; 339 + if (clkout_rates[i] <= req->rate) { 340 + req->rate = clkout_rates[i]; 341 341 342 - return clkout_rates[0]; 342 + return 0; 343 + } 344 + 345 + req->rate = clkout_rates[0]; 346 + 347 + return 0; 343 348 } 344 349 345 350 static int pcf8563_clkout_set_rate(struct clk_hw *hw, unsigned long rate, ··· 418 413 .unprepare = pcf8563_clkout_unprepare, 419 414 .is_prepared = pcf8563_clkout_is_prepared, 420 415 .recalc_rate = pcf8563_clkout_recalc_rate, 421 - .round_rate = pcf8563_clkout_round_rate, 416 + .determine_rate = pcf8563_clkout_determine_rate, 422 417 .set_rate = pcf8563_clkout_set_rate, 423 418 }; 424 419