Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: rockchip: px30: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage

In order to get rid of CLK_NR_CLKS and CLKPMU_NR_CLKS
and be able to drop it from the bindings, use
rockchip_clk_find_max_clk_id helper to find the
highest clock id.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Link: https://lore.kernel.org/r/5ad12808-61f5-4e3b-801e-85231375b6a6@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>

authored by

Johan Jonker and committed by
Heiko Stuebner
2496910c 1d34b975

+8 -2
+8 -2
drivers/clk/rockchip/clk-px30.c
··· 1002 1002 static void __init px30_clk_init(struct device_node *np) 1003 1003 { 1004 1004 struct rockchip_clk_provider *ctx; 1005 + unsigned long clk_nr_clks; 1005 1006 void __iomem *reg_base; 1006 1007 1007 1008 reg_base = of_iomap(np, 0); ··· 1011 1010 return; 1012 1011 } 1013 1012 1014 - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); 1013 + clk_nr_clks = rockchip_clk_find_max_clk_id(px30_clk_branches, 1014 + ARRAY_SIZE(px30_clk_branches)) + 1; 1015 + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); 1015 1016 if (IS_ERR(ctx)) { 1016 1017 pr_err("%s: rockchip clk init failed\n", __func__); 1017 1018 iounmap(reg_base); ··· 1046 1043 static void __init px30_pmu_clk_init(struct device_node *np) 1047 1044 { 1048 1045 struct rockchip_clk_provider *ctx; 1046 + unsigned long clkpmu_nr_clks; 1049 1047 void __iomem *reg_base; 1050 1048 1051 1049 reg_base = of_iomap(np, 0); ··· 1055 1051 return; 1056 1052 } 1057 1053 1058 - ctx = rockchip_clk_init(np, reg_base, CLKPMU_NR_CLKS); 1054 + clkpmu_nr_clks = rockchip_clk_find_max_clk_id(px30_clk_pmu_branches, 1055 + ARRAY_SIZE(px30_clk_pmu_branches)) + 1; 1056 + ctx = rockchip_clk_init(np, reg_base, clkpmu_nr_clks); 1059 1057 if (IS_ERR(ctx)) { 1060 1058 pr_err("%s: rockchip pmu clk init failed\n", __func__); 1061 1059 return;