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

clk: rockchip: rk3228: 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/2ee6f0a5-a1bb-4b62-ae6b-8f3828f8eccc@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>

authored by

Johan Jonker and committed by
Heiko Stuebner
819b2e19 ec4f4261

+4 -1
+4 -1
drivers/clk/rockchip/clk-rk3228.c
··· 683 683 static void __init rk3228_clk_init(struct device_node *np) 684 684 { 685 685 struct rockchip_clk_provider *ctx; 686 + unsigned long clk_nr_clks; 686 687 void __iomem *reg_base; 687 688 688 689 reg_base = of_iomap(np, 0); ··· 692 691 return; 693 692 } 694 693 695 - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); 694 + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3228_clk_branches, 695 + ARRAY_SIZE(rk3228_clk_branches)) + 1; 696 + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); 696 697 if (IS_ERR(ctx)) { 697 698 pr_err("%s: rockchip clk init failed\n", __func__); 698 699 iounmap(reg_base);