summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDavid Lechner <[email protected]>2026-01-07 09:50:17 -0600
committerTom Rini <[email protected]>2026-01-12 13:14:02 -0600
commiteb2bf2bc832d34440204ad90795ca7475ede4402 (patch)
tree0f3a86c9cbd4735d99c9f2c9a6eb8c560de12a52 /drivers
parentcc1a458a3d315bd94ed2b5faf7e74baf8f667d9b (diff)
clk: mediatek: mt7623: set unmapped IDs to -1
Add range initializers to the id_offs_map arrays in the mt7623 clk driver to set unmapped IDs to -1. This prevents accidental usage of unmapped IDs that would otherwise map to 0. mtk_common_clk_of_xlate() checks these values for < 0 and returns -ENOENT in that case. A range initializer covering the entire array is used since it is less error-prone than manually looking up the value of each macro in the existing initializers and checking for gaps. It is placed first so that the specific initializers override it. Signed-off-by: David Lechner <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/mediatek/clk-mt7623.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/clk/mediatek/clk-mt7623.c b/drivers/clk/mediatek/clk-mt7623.c
index eca8352d8e6..6ce1d729736 100644
--- a/drivers/clk/mediatek/clk-mt7623.c
+++ b/drivers/clk/mediatek/clk-mt7623.c
@@ -26,6 +26,7 @@
/* apmixedsys */
static const int pll_id_offs_map[] = {
+ [0 ... CLK_APMIXED_NR - 1] = -1,
[CLK_APMIXED_ARMPLL] = 0,
[CLK_APMIXED_MAINPLL] = 1,
[CLK_APMIXED_UNIVPLL] = 2,
@@ -92,6 +93,7 @@ static const struct mtk_pll_data apmixed_plls[] = {
#define CLK_TOP_HDMITX_CLKDIG_CTS CLK_TOP_NR
static const int top_id_offs_map[CLK_TOP_NR + 1] = {
+ [0 ... CLK_TOP_NR] = -1,
/* Fixed CLK */
[CLK_TOP_DPI] = 0,
[CLK_TOP_DMPLL] = 1,
@@ -808,6 +810,7 @@ static const struct mtk_gate infra_cgs[] = {
/* pericfg */
static const int peri_id_offs_map[] = {
+ [0 ... CLK_PERI_NR - 1] = -1,
/* MUX CLK */
[CLK_PERI_UART0_SEL] = 1,
[CLK_PERI_UART1_SEL] = 2,