]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: codecs: pm4125: Remove irq_chip on component unbind
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 23 Oct 2025 09:02:51 +0000 (11:02 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 13 Nov 2025 19:30:40 +0000 (19:30 +0000)
Component bind uses devm_regmap_add_irq_chip() to add IRQ chip, so it
will be removed only during driver unbind, not component unbind.
A component unbind-bind cycle for the same Linux device lifetime would
result in two chips added.  Fix this by manually removing the IRQ chip
during component unbind.

Fixes: 8ad529484937 ("ASoC: codecs: add new pm4125 audio codec driver")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20251023-asoc-regmap-irq-chip-v1-2-17ad32680913@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/pm4125.c

index 0d4223335e67bb91d73259b8ceac7918355a222e..6f18523771fe28a6aa2fd99d005f2c8fa632ff7c 100644 (file)
@@ -1610,6 +1610,8 @@ static void pm4125_unbind(struct device *dev)
        struct pm4125_priv *pm4125 = dev_get_drvdata(dev);
 
        snd_soc_unregister_component(dev);
+       devm_regmap_del_irq_chip(dev, irq_find_mapping(pm4125->virq, 0),
+                                pm4125->irq_chip);
        device_link_remove(dev, pm4125->txdev);
        device_link_remove(dev, pm4125->rxdev);
        device_link_remove(pm4125->rxdev, pm4125->txdev);