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.

clk: samsung: pll: 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/20250811-clk-for-stephen-round-rate-v1-99-b3bf97b038dc@redhat.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

authored by

Brian Masney and committed by
Krzysztof Kozlowski
e278e39b 05c58c94

+19 -14
+19 -14
drivers/clk/samsung/clk-pll.c
··· 49 49 return NULL; 50 50 } 51 51 52 - static long samsung_pll_round_rate(struct clk_hw *hw, 53 - unsigned long drate, unsigned long *prate) 52 + static int samsung_pll_determine_rate(struct clk_hw *hw, 53 + struct clk_rate_request *req) 54 54 { 55 55 struct samsung_clk_pll *pll = to_clk_pll(hw); 56 56 const struct samsung_pll_rate_table *rate_table = pll->rate_table; ··· 58 58 59 59 /* Assuming rate_table is in descending order */ 60 60 for (i = 0; i < pll->rate_count; i++) { 61 - if (drate >= rate_table[i].rate) 62 - return rate_table[i].rate; 61 + if (req->rate >= rate_table[i].rate) { 62 + req->rate = rate_table[i].rate; 63 + 64 + return 0; 65 + } 63 66 } 64 67 65 68 /* return minimum supported value */ 66 - return rate_table[i - 1].rate; 69 + req->rate = rate_table[i - 1].rate; 70 + 71 + return 0; 67 72 } 68 73 69 74 static bool pll_early_timeout = true; ··· 303 298 304 299 static const struct clk_ops samsung_pll35xx_clk_ops = { 305 300 .recalc_rate = samsung_pll35xx_recalc_rate, 306 - .round_rate = samsung_pll_round_rate, 301 + .determine_rate = samsung_pll_determine_rate, 307 302 .set_rate = samsung_pll35xx_set_rate, 308 303 .enable = samsung_pll3xxx_enable, 309 304 .disable = samsung_pll3xxx_disable, ··· 416 411 static const struct clk_ops samsung_pll36xx_clk_ops = { 417 412 .recalc_rate = samsung_pll36xx_recalc_rate, 418 413 .set_rate = samsung_pll36xx_set_rate, 419 - .round_rate = samsung_pll_round_rate, 414 + .determine_rate = samsung_pll_determine_rate, 420 415 .enable = samsung_pll3xxx_enable, 421 416 .disable = samsung_pll3xxx_disable, 422 417 }; ··· 519 514 520 515 static const struct clk_ops samsung_pll0822x_clk_ops = { 521 516 .recalc_rate = samsung_pll0822x_recalc_rate, 522 - .round_rate = samsung_pll_round_rate, 517 + .determine_rate = samsung_pll_determine_rate, 523 518 .set_rate = samsung_pll0822x_set_rate, 524 519 .enable = samsung_pll3xxx_enable, 525 520 .disable = samsung_pll3xxx_disable, ··· 617 612 static const struct clk_ops samsung_pll0831x_clk_ops = { 618 613 .recalc_rate = samsung_pll0831x_recalc_rate, 619 614 .set_rate = samsung_pll0831x_set_rate, 620 - .round_rate = samsung_pll_round_rate, 615 + .determine_rate = samsung_pll_determine_rate, 621 616 .enable = samsung_pll3xxx_enable, 622 617 .disable = samsung_pll3xxx_disable, 623 618 }; ··· 740 735 741 736 static const struct clk_ops samsung_pll45xx_clk_ops = { 742 737 .recalc_rate = samsung_pll45xx_recalc_rate, 743 - .round_rate = samsung_pll_round_rate, 738 + .determine_rate = samsung_pll_determine_rate, 744 739 .set_rate = samsung_pll45xx_set_rate, 745 740 }; 746 741 ··· 885 880 886 881 static const struct clk_ops samsung_pll46xx_clk_ops = { 887 882 .recalc_rate = samsung_pll46xx_recalc_rate, 888 - .round_rate = samsung_pll_round_rate, 883 + .determine_rate = samsung_pll_determine_rate, 889 884 .set_rate = samsung_pll46xx_set_rate, 890 885 }; 891 886 ··· 1098 1093 1099 1094 static const struct clk_ops samsung_pll2550xx_clk_ops = { 1100 1095 .recalc_rate = samsung_pll2550xx_recalc_rate, 1101 - .round_rate = samsung_pll_round_rate, 1096 + .determine_rate = samsung_pll_determine_rate, 1102 1097 .set_rate = samsung_pll2550xx_set_rate, 1103 1098 }; 1104 1099 ··· 1190 1185 1191 1186 static const struct clk_ops samsung_pll2650x_clk_ops = { 1192 1187 .recalc_rate = samsung_pll2650x_recalc_rate, 1193 - .round_rate = samsung_pll_round_rate, 1188 + .determine_rate = samsung_pll_determine_rate, 1194 1189 .set_rate = samsung_pll2650x_set_rate, 1195 1190 }; 1196 1191 ··· 1282 1277 static const struct clk_ops samsung_pll2650xx_clk_ops = { 1283 1278 .recalc_rate = samsung_pll2650xx_recalc_rate, 1284 1279 .set_rate = samsung_pll2650xx_set_rate, 1285 - .round_rate = samsung_pll_round_rate, 1280 + .determine_rate = samsung_pll_determine_rate, 1286 1281 }; 1287 1282 1288 1283 static const struct clk_ops samsung_pll2650xx_clk_min_ops = {