]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: codecs: pm4125: Fix potential conflict when probing two devices
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 23 Oct 2025 09:02:50 +0000 (11:02 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 13 Nov 2025 19:30:39 +0000 (19:30 +0000)
commitfd94857a934cbe613353810a024c84d54826ead3
treefbe2c0d0778ae1a1714318735fa660787aacefda
parent123cd174a3782307787268adf45f22de4d290128
ASoC: codecs: pm4125: Fix potential conflict when probing two devices

Qualcomm PM4125 codec is always a single device on the board, however
nothing stops board designers to have two of them, thus same device
driver could probe twice.

Device driver is not ready for that case, because it allocates
statically 'struct regmap_irq_chip' as non-const and stores during
component bind in 'irq_drv_data' member a pointer to per-probe state
container ('struct pm4125_priv').

Second component bind would overwrite the 'irq_drv_data' from previous
device probe, so interrupts would be executed in wrong context.

The fix makes use of currently unused 'struct pm4125_priv' member
'pm4125_regmap_irq_chip', but renames it to a shorter name.

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-1-17ad32680913@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/pm4125.c