Skip to content

Commit 0758fe9

Browse files
Johan Jonkermmind
authored andcommitted
clk: rockchip: rk3328: 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 31fe149 commit 0758fe9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/clk/rockchip/clk-rk3328.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ static const char *const rk3328_critical_clocks[] __initconst = {
881881
static void __init rk3328_clk_init(struct device_node *np)
882882
{
883883
struct rockchip_clk_provider *ctx;
884+
unsigned long clk_nr_clks;
884885
void __iomem *reg_base;
885886

886887
reg_base = of_iomap(np, 0);
@@ -889,7 +890,9 @@ static void __init rk3328_clk_init(struct device_node *np)
889890
return;
890891
}
891892

892-
ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS);
893+
clk_nr_clks = rockchip_clk_find_max_clk_id(rk3328_clk_branches,
894+
ARRAY_SIZE(rk3328_clk_branches)) + 1;
895+
ctx = rockchip_clk_init(np, reg_base, clk_nr_clks);
893896
if (IS_ERR(ctx)) {
894897
pr_err("%s: rockchip clk init failed\n", __func__);
895898
iounmap(reg_base);

0 commit comments

Comments
 (0)