All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: mediatek: mt6359: Fix unexpected error in bind/unbind flow
@ 2021-09-15  3:46 ` Trevor Wu
  0 siblings, 0 replies; 8+ messages in thread
From: Trevor Wu @ 2021-09-15  3:46 UTC (permalink / raw)
  To: broonie, tiwai, matthias.bgg
  Cc: trevor.wu, alsa-devel, linux-mediatek, linux-arm-kernel,
	linux-kernel, shane.chien, chipeng.chang, jiaxin.yu, tzungbi

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.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
---
 sound/soc/codecs/mt6359.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/mt6359.c b/sound/soc/codecs/mt6359.c
index 2d6a4a29b850..f8532aa7e4aa 100644
--- a/sound/soc/codecs/mt6359.c
+++ b/sound/soc/codecs/mt6359.c
@@ -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);
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-15 15:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15  3:46 [PATCH] ASoC: mediatek: mt6359: Fix unexpected error in bind/unbind flow Trevor Wu
2021-09-15  3:46 ` Trevor Wu
2021-09-15  3:46 ` Trevor Wu
2021-09-15  3:46 ` Trevor Wu
2021-09-15 15:21 ` Mark Brown
2021-09-15 15:21   ` Mark Brown
2021-09-15 15:21   ` Mark Brown
2021-09-15 15:21   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.