[PATCH v1 3/7] ALSA: hda: cs35l41: Unset irq if not used or configured

From: Stefan Binding

Date: Fri Nov 20 2026 - 11:12:24 EST


If the irq is not allocated, or does not exist in ACPI, clear the saved
irq value. This prevents the driver from being able to access an
unconfigured or unused irq later.

Signed-off-by: Stefan Binding <sbinding@xxxxxxxxxxxxxxxxxxxxx>
---
sound/hda/codecs/side-codecs/cs35l41_hda.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/sound/hda/codecs/side-codecs/cs35l41_hda.c b/sound/hda/codecs/side-codecs/cs35l41_hda.c
index f6910916ad47..2e2bf231d3fc 100644
--- a/sound/hda/codecs/side-codecs/cs35l41_hda.c
+++ b/sound/hda/codecs/side-codecs/cs35l41_hda.c
@@ -1633,6 +1633,8 @@ static void cs35l41_configure_interrupt(struct cs35l41_hda *cs35l41, int irq_pol
IRQF_ONESHOT | IRQF_SHARED | irq_pol,
0, &cs35l41_regmap_irq_chip, &cs35l41->irq_data);
if (ret) {
+ /* unset irq if unable to be used */
+ cs35l41->irq = 0;
dev_dbg(cs35l41->dev, "Unable to add IRQ Chip: %d.", ret);
goto err;
}
@@ -1712,6 +1714,9 @@ static int cs35l41_hda_apply_properties(struct cs35l41_hda *cs35l41)

if (using_irq)
cs35l41_configure_interrupt(cs35l41, irq_pol);
+ else
+ /* Unset irq if not used */
+ cs35l41->irq = 0;

return cs35l41_hda_channel_map(cs35l41);
}
--
2.43.0