Drop RK3568's variant of the CLK_NR_CLKS constant
Subsystems (3)
Heiko Stuebner
maintainercover Drop RK3568's variant of the CLK_NR_CLKS constant
This drops the use of the CLK_NR_CLKS constant from the rk3568 clock driver and after that, drops the constant from the binding that should not have been part of it in the first place.
Heiko Stuebner (2):
clk: rockchip: rk3568: Drop CLK_NR_CLKS usage
dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define
drivers/clk/rockchip/clk-rk3568.c | 5 ++++- include/dt-bindings/clock/rk3568-cru.h | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.47.2
Heiko Stuebner
maintainerPATCH 1/2 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.
--- drivers/clk/rockchip/clk-rk3568.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3568.c +4 -1
@@ -1652,6 +1652,7 @@ CLK_OF_DECLARE(rk3568_cru_pmu, "rockchip,rk3568-pmucru", rk3568_pmu_clk_init);static void __init rk3568_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clk_nr_clks;void __iomem *reg_base; reg_base =of_iomap (np,0 );
@@ -1660,7 +1661,9 @@ static void __init rk3568_clk_init(struct device_node *np)return ; } - ctx =rockchip_clk_init (np, reg_base,CLK_NR_CLKS ); + clk_nr_clks =rockchip_clk_find_max_clk_id (rk3568_clk_branches, +ARRAY_SIZE (rk3568_clk_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clk_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip clk init failed\n" , __func__);iounmap (reg_base);
Signature · 1 line
2.47.2
Re: [PATCH 1/2] clk: rockchip: rk3568: Drop CLK_NR_CLKS usage
Hi,
Quoted 6 lines · Heiko Stuebner
In order to get rid of
CLK_NR_CLKSand be able to drop it from the bindings, userockchip_clk_find_max_clk_idhelper to find the highest clock id.Signed-off-by Heiko Stuebner <[email protected]>---
-- Sebastian
Quoted 30 lines
drivers/clk/rockchip/clk-rk3568.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/clk/rockchip/clk-rk3568.c +4
-1@@ -1652,6 +1652,7 @@ CLK_OF_DECLARE(rk3568_cru_pmu, "rockchip,rk3568-pmucru", rk3568_pmu_clk_init);static void __init rk3568_clk_init (struct device_node *np) {struct rockchip_clk_provider *ctx; +unsigned long clk_nr_clks;void __iomem *reg_base; reg_base =of_iomap (np,0 );@@ -1660,7 +1661,9 @@ static void __init rk3568_clk_init(struct device_node *np)return ; } - ctx =rockchip_clk_init (np, reg_base,CLK_NR_CLKS ); + clk_nr_clks =rockchip_clk_find_max_clk_id (rk3568_clk_branches, +ARRAY_SIZE (rk3568_clk_branches)) +1 ; + ctx =rockchip_clk_init (np, reg_base, clk_nr_clks);if (IS_ERR (ctx)) {pr_err ("%s: rockchip clk init failed\n" , __func__);iounmap (reg_base);Signature · 1 line
2.47.2
Heiko Stuebner
maintainerPATCH 2/2 dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define
In reply to Heiko StuebnerCLK_NR_CLKS has always only be used on the driver side to calculate array sizes should never have been part of the clock-binding.
Let's drop it, since the kernel code no longer uses it either and nothing else has ever used it.
--- include/dt-bindings/clock/rk3568-cru.h | 2 -- 1 file changed, 2 deletions(-)
include/dt-bindings/clock/rk3568-cru.h +0 -2
@@ -483,8 +483,6 @@#define PCLK_CORE_PVTM 450 -#define CLK_NR_CLKS (PCLK_CORE_PVTM + 1) -/* pmu soft-reset indices */ /* pmucru_softrst_con0 */ #define SRST_P_PDPMU_NIU 0
Signature · 1 line
2.47.2
Re: [PATCH 2/2] dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define
pw-bot: not-applicable
Quoted 9 lines · Heiko Stuebner
This drops the use of the
CLK_NR_CLKSconstant from the rk3568 clock driver and after that, drops the constant from the binding that should not have been part of it in the first place.Heiko Stuebner (2):
clk: rockchip: rk3568: DropCLK_NR_CLKSusage
dt-bindings: clock: rk3568: DropCLK_NR_CLKSdefine[...]
Applied, thanks!
[1/2] clk: rockchip: rk3568: Drop CLK_NR_CLKS usage
commit: 2a42e3210d4331dddfb04b020050bd774cf99659
[2/2] dt-bindings: clock: rk3568: Drop CLK_NR_CLKS define
commit: ca38f0f65eefd79889b409c89c6932d7e2fe0993Best regards,
Signature · 1 line
Heiko Stuebner <[email protected]>