[PATCH FIX] mfd: sec-irq: fix non-constant case labels in s2mu005_irq_get_reg

From: Łukasz Lebiedziński

Date: Sun Feb 08 2026 - 23:04:47 EST


Case labels must be compile-time constants, but the original
implementation used array element values like irqf_regs[0], causing
a compilation error:

drivers/mfd/sec-irq.c:218:9: error: case label does not reduce to
an integer constant

Replace array-based case labels with explicit S2MU005_REG_* defines
for all four interrupt status and mask registers, preserving the
original logic.

This addresses an issue in the S2MU005 PMIC support patches [1].

Link: https://lore.kernel.org/all/20260126-s2mu005-pmic-v2-6-78f1a75f547a@xxxxxxxxxxx/#Z31drivers:mfd:sec-irq.c [1]
Signed-off-by: Łukasz Lebiedziński <kernel@xxxxxxxxx>
---
drivers/mfd/sec-irq.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index 44a1eb074a08..73a611ba0502 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -215,9 +215,15 @@ static unsigned int s2mu005_irq_get_reg(struct regmap_irq_chip_data *data,
};

switch (base) {
- case irqf_regs[0]:
+ case S2MU005_REG_CHGR_INT1:
+ case S2MU005_REG_FLED_INT1:
+ case S2MU005_REG_MUIC_INT1:
+ case S2MU005_REG_MUIC_INT2:
return irqf_regs[index];
- case mask_regs[0]:
+ case S2MU005_REG_CHGR_INT1M:
+ case S2MU005_REG_FLED_INT1M:
+ case S2MU005_REG_MUIC_INT1M:
+ case S2MU005_REG_MUIC_INT2M:
return mask_regs[index];
}

--
2.53.0