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

clk: rockchip: rk3036: 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 <jbx6244@gmail.com>
Link: https://lore.kernel.org/r/c8e73847-f472-4473-ac55-068cb28b98f6@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>

authored by

Johan Jonker and committed by
Heiko Stuebner
ec4f4261 2496910c

+4 -1
+4 -1
drivers/clk/rockchip/clk-rk3036.c
··· 436 436 static void __init rk3036_clk_init(struct device_node *np) 437 437 { 438 438 struct rockchip_clk_provider *ctx; 439 + unsigned long clk_nr_clks; 439 440 void __iomem *reg_base; 440 441 struct clk *clk; 441 442 ··· 453 452 writel_relaxed(HIWORD_UPDATE(0x2, 0x3, 10), 454 453 reg_base + RK2928_CLKSEL_CON(13)); 455 454 456 - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); 455 + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3036_clk_branches, 456 + ARRAY_SIZE(rk3036_clk_branches)) + 1; 457 + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); 457 458 if (IS_ERR(ctx)) { 458 459 pr_err("%s: rockchip clk init failed\n", __func__); 459 460 iounmap(reg_base);