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

Configure Feed

Select the types of activity you want to include in your feed.

clk: rockchip: rk3399: Drop CLK_NR_CLKS CLKPMU_NR_CLKS usage

In order to get rid of CLK_NR_CLKS and CLKPMU_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/45f83b1f-64f8-4ea5-bc93-ebf7507a9709@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>

authored by

Johan Jonker and committed by
Heiko Stuebner
1a229868 41563197

+8 -2
+8 -2
drivers/clk/rockchip/clk-rk3399.c
··· 1531 1531 static void __init rk3399_clk_init(struct device_node *np) 1532 1532 { 1533 1533 struct rockchip_clk_provider *ctx; 1534 + unsigned long clk_nr_clks; 1534 1535 void __iomem *reg_base; 1535 1536 1536 1537 reg_base = of_iomap(np, 0); ··· 1540 1539 return; 1541 1540 } 1542 1541 1543 - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); 1542 + clk_nr_clks = rockchip_clk_find_max_clk_id(rk3399_clk_branches, 1543 + ARRAY_SIZE(rk3399_clk_branches)) + 1; 1544 + ctx = rockchip_clk_init(np, reg_base, clk_nr_clks); 1544 1545 if (IS_ERR(ctx)) { 1545 1546 pr_err("%s: rockchip clk init failed\n", __func__); 1546 1547 iounmap(reg_base); ··· 1580 1577 static void __init rk3399_pmu_clk_init(struct device_node *np) 1581 1578 { 1582 1579 struct rockchip_clk_provider *ctx; 1580 + unsigned long clkpmu_nr_clks; 1583 1581 void __iomem *reg_base; 1584 1582 1585 1583 reg_base = of_iomap(np, 0); ··· 1589 1585 return; 1590 1586 } 1591 1587 1592 - ctx = rockchip_clk_init(np, reg_base, CLKPMU_NR_CLKS); 1588 + clkpmu_nr_clks = rockchip_clk_find_max_clk_id(rk3399_clk_pmu_branches, 1589 + ARRAY_SIZE(rk3399_clk_pmu_branches)) + 1; 1590 + ctx = rockchip_clk_init(np, reg_base, clkpmu_nr_clks); 1593 1591 if (IS_ERR(ctx)) { 1594 1592 pr_err("%s: rockchip pmu clk init failed\n", __func__); 1595 1593 iounmap(reg_base);