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

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

+4 -1
+4 -1
drivers/clk/rockchip/clk-rk3568.c
··· 1652 1652 static void __init rk3568_clk_init(struct device_node *np) 1653 1653 { 1654 1654 struct rockchip_clk_provider *ctx; 1655 + unsigned long clk_nr_clks; 1655 1656 void __iomem *reg_base; 1656 1657 1657 1658 reg_base = of_iomap(np, 0); ··· 1661 1660 return; 1662 1661 } 1663 1662 1664 - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); 1663 + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3568_clk_branches, 1664 + ARRAY_SIZE(rk3568_clk_branches)) + 1; 1665 + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); 1665 1666 if (IS_ERR(ctx)) { 1666 1667 pr_err("%s: rockchip clk init failed\n", __func__); 1667 1668 iounmap(reg_base);