Skip to content

Commit 4156319

Browse files
Johan Jonkermmind
authored andcommitted
clk: rockchip: rk3368: 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/2a19c3cc-5f4d-4d03-90b2-e0bb13b0502f@gmail.com Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent 0758fe9 commit 4156319

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/clk/rockchip/clk-rk3368.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,7 @@ static const char *const rk3368_critical_clocks[] __initconst = {
866866
static void __init rk3368_clk_init(struct device_node *np)
867867
{
868868
struct rockchip_clk_provider *ctx;
869+
unsigned long clk_nr_clks;
869870
void __iomem *reg_base;
870871

871872
reg_base = of_iomap(np, 0);
@@ -874,7 +875,9 @@ static void __init rk3368_clk_init(struct device_node *np)
874875
return;
875876
}
876877

877-
ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS);
878+
clk_nr_clks = rockchip_clk_find_max_clk_id(rk3368_clk_branches,
879+
ARRAY_SIZE(rk3368_clk_branches)) + 1;
880+
ctx = rockchip_clk_init(np, reg_base, clk_nr_clks);
878881
if (IS_ERR(ctx)) {
879882
pr_err("%s: rockchip clk init failed\n", __func__);
880883
iounmap(reg_base);

0 commit comments

Comments
 (0)