Skip to content

Commit 2a42e32

Browse files
committed
clk: rockchip: rk3568: 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. Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20251103234032.413563-2-heiko@sntech.de
1 parent 88b6a93 commit 2a42e32

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/clk/rockchip/clk-rk3568.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,7 @@ CLK_OF_DECLARE(rk3568_cru_pmu, "rockchip,rk3568-pmucru", rk3568_pmu_clk_init);
16521652
static void __init rk3568_clk_init(struct device_node *np)
16531653
{
16541654
struct rockchip_clk_provider *ctx;
1655+
unsigned long clk_nr_clks;
16551656
void __iomem *reg_base;
16561657

16571658
reg_base = of_iomap(np, 0);
@@ -1660,7 +1661,9 @@ static void __init rk3568_clk_init(struct device_node *np)
16601661
return;
16611662
}
16621663

1663-
ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS);
1664+
clk_nr_clks = rockchip_clk_find_max_clk_id(rk3568_clk_branches,
1665+
ARRAY_SIZE(rk3568_clk_branches)) + 1;
1666+
ctx = rockchip_clk_init(np, reg_base, clk_nr_clks);
16641667
if (IS_ERR(ctx)) {
16651668
pr_err("%s: rockchip clk init failed\n", __func__);
16661669
iounmap(reg_base);

0 commit comments

Comments
 (0)