Skip to content

Commit 545b131

Browse files
Johan Jonkermmind
authored andcommitted
clk: rockchip: rk3288: Drop CLK_NR_CLKS usage
In order to get rid of CLK_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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 819b2e1 commit 545b131

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/clk/rockchip/clk-rk3288.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,14 +932,17 @@ static void __init rk3288_common_init(struct device_node *np,
932932
enum rk3288_variant soc)
933933
{
934934
struct rockchip_clk_provider *ctx;
935+
unsigned long clk_nr_clks;
935936

936937
rk3288_cru_base = of_iomap(np, 0);
937938
if (!rk3288_cru_base) {
938939
pr_err("%s: could not map cru region\n", __func__);
939940
return;
940941
}
941942

942-
ctx = rockchip_clk_init(np, rk3288_cru_base, CLK_NR_CLKS);
943+
clk_nr_clks = rockchip_clk_find_max_clk_id(rk3288_clk_branches,
944+
ARRAY_SIZE(rk3288_clk_branches)) + 1;
945+
ctx = rockchip_clk_init(np, rk3288_cru_base, clk_nr_clks);
943946
if (IS_ERR(ctx)) {
944947
pr_err("%s: rockchip clk init failed\n", __func__);
945948
iounmap(rk3288_cru_base);

0 commit comments

Comments
 (0)