Skip to contentSkip to conversation

ASoC: mediatek: mt6359: Fix unexpected error in bind/unbind flow

PATCH In review Trevor Wu 2 participants 2 messages Sep 15, 2021

Subsystems (3)
lore
Share & tools
lore

Trevor Wu

author
#0 lore raw

PATCH 1/1 ASoC: mediatek: mt6359: Fix unexpected error in bind/unbind flow

mt6359-sound is a MFD driver. Because its regmap is retrieved from its parent, it shouldn't be freed in mt6359-sound driver.

snd_soc_component_exit_regmap() will do regmap_exit(), this results in unexpected results if sound card unregister flow is invoked when users try to bind/unbind audio codec.

Remove the usage of snd_soc_component_exit_regmap(). Instead, set component->regmap = NULL in the component remove function.

---
 sound/soc/codecs/mt6359.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/mt6359.c +1 -1
index 2d6a4a29b850..f8532aa7e4aa 100644
@@ -2697,7 +2697,7 @@ static int mt6359_codec_probe(struct snd_soc_component *cmpnt)
 
 static void mt6359_codec_remove(struct snd_soc_component *cmpnt)
 {
-	snd_soc_component_exit_regmap(cmpnt);
+	cmpnt->regmap = NULL;
 }
 
 static const DECLARE_TLV_DB_SCALE(hp_playback_tlv, -2200, 100, 0);
Signature · 1 line
2.18.0
maintainer
#1 lore raw
Quoted 8 lines · Trevor Wu

mt6359-sound is a MFD driver. Because its regmap is retrieved from its parent, it shouldn't be freed in mt6359-sound driver.

snd_soc_component_exit_regmap() will do regmap_exit(), this results in unexpected results if sound card unregister flow is invoked when users try to bind/unbind audio codec.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: mediatek: mt6359: Fix unexpected error in bind/unbind flow

      commit: 6d66c5ccf5cb8af866fe2bb014098a3dd7bfa3cc

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark