[PATCH v4 3/7] MIPS: ath79: stop using ATH79_CLK_END
From: Rosen Penev
Date: Sat Nov 14 2026 - 18:43:13 EST
ATH79_CLK_END counts the clocks in the dt-bindings header, which means
it has to change whenever a clock is added, but it is not part of the
ABI. Size the clock table from the IDs that the clock code uses
instead, so the define can be dropped from the header.
Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
arch/mips/ath79/clock.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c
index 6a8bef782186..55d8ef8c1c8c 100644
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
@@ -25,13 +25,15 @@
#include <asm/mach-ath79/ar71xx_regs.h>
#include "common.h"
-static struct clk *clks[ATH79_CLK_END];
+#define ATH79_CLK_NUM (ATH79_CLK_MDIO + 1)
+
+static struct clk *clks[ATH79_CLK_NUM];
static struct clk_onecell_data clk_data = {
.clks = clks,
.clk_num = ARRAY_SIZE(clks),
};
-static const char * const clk_names[ATH79_CLK_END] = {
+static const char * const clk_names[ATH79_CLK_NUM] = {
[ATH79_CLK_CPU] = "cpu",
[ATH79_CLK_DDR] = "ddr",
[ATH79_CLK_AHB] = "ahb",
--
2.56.1