Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: cs42l43: Add clear of stashed pointer on component remove
@ 2024-02-02 14:06 Charles Keepax
  2024-02-02 14:06 ` [PATCH 2/3] ASoC: cs42l43: Sync the hp ilimit works when removing the component Charles Keepax
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Charles Keepax @ 2024-02-02 14:06 UTC (permalink / raw)
  To: broonie; +Cc: lgirdwood, alsa-devel, patches, linux-sound

If the component is removed the stashed component pointer in the
CODECs private struct should also be cleared to prevent use of a stale
pointer.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 sound/soc/codecs/cs42l43.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c
index 2c402086924d..9e1deb3242cb 100644
--- a/sound/soc/codecs/cs42l43.c
+++ b/sound/soc/codecs/cs42l43.c
@@ -2111,10 +2111,18 @@ static int cs42l43_component_probe(struct snd_soc_component *component)
 	return 0;
 }
 
+static void cs42l43_component_remove(struct snd_soc_component *component)
+{
+	struct cs42l43_codec *priv = snd_soc_component_get_drvdata(component);
+
+	priv->component = NULL;
+}
+
 static const struct snd_soc_component_driver cs42l43_component_drv = {
 	.name			= "cs42l43-codec",
 
 	.probe			= cs42l43_component_probe,
+	.remove			= cs42l43_component_remove,
 	.set_sysclk		= cs42l43_set_sysclk,
 	.set_jack		= cs42l43_set_jack,
 
-- 
2.30.2


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

end of thread, other threads:[~2024-02-06  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02 14:06 [PATCH 1/3] ASoC: cs42l43: Add clear of stashed pointer on component remove Charles Keepax
2024-02-02 14:06 ` [PATCH 2/3] ASoC: cs42l43: Sync the hp ilimit works when removing the component Charles Keepax
2024-02-02 14:06 ` [PATCH 3/3] ASoC: cs42l43: Shut down jack detection on component remove Charles Keepax
2024-02-06  9:37 ` [PATCH 1/3] ASoC: cs42l43: Add clear of stashed pointer " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox