Skip to contentSkip to conversation

ASoC: cs35l56: Destroy workqueue in probe error path

PATCH In review Richard Fitzgerald 1 participant 2 messages May 1

Subsystems (3)
lore
Share & tools
lore

Richard Fitzgerald

author maintainer
#0 lore raw

PATCH 1/1 ASoC: cs35l56: Destroy workqueue in probe error path

The error path in cs35l56_common_probe() should call destroy_workqueue() on the workqueue that was created by cs35l56_dsp_init().

Fixes e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")
---
 sound/soc/codecs/cs35l56.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/codecs/cs35l56.c +3 -0
index 378017fcea10..401a41b648f5 100644
@@ -1970,6 +1970,9 @@ int cs35l56_common_probe(struct cs35l56_private *cs35l56)
 	gpiod_set_value_cansleep(cs35l56->base.reset_gpio, 0);
 	regulator_bulk_disable(ARRAY_SIZE(cs35l56->supplies), cs35l56->supplies);
 
+	if (cs35l56->dsp_wq)
+		destroy_workqueue(cs35l56->dsp_wq);
+
 	return ret;
 }
 EXPORT_SYMBOL_NS_GPL(cs35l56_common_probe, "SND_SOC_CS35L56_CORE");
Signature · 1 line
2.47.3
author maintainer
#1 lore raw
Quoted 14 lines · Richard Fitzgerald

The error path in cs35l56_common_probe() should call destroy_workqueue() on the workqueue that was created by cs35l56_dsp_init().

Fixes e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56")
---
  sound/soc/codecs/cs35l56.c | 3 +++
  1 file changed, 3 insertions(+)
sound/soc/codecs/cs35l56.c +0 -0
index 378017fcea10..401a41b648f5 100644

sound/soc/codecs/cs35l56.c int cs35l56_common_probe(struct cs35l56_private *cs35l56) · line 1978

Quoted 9 lines
sound/soc/codecs/cs35l56.c +3 -0
@@ -1970,6 +1970,9 @@ int cs35l56_common_probe(struct cs35l56_private *cs35l56)
  	gpiod_set_value_cansleep(cs35l56->base.reset_gpio, 0);
  	regulator_bulk_disable(ARRAY_SIZE(cs35l56->supplies), cs35l56->supplies);
 
+	if (cs35l56->dsp_wq)
+		destroy_workqueue(cs35l56->dsp_wq);
+
  	return ret;
  }
  EXPORT_SYMBOL_NS_GPL(cs35l56_common_probe, "SND_SOC_CS35L56_CORE");

On second thoughts, it would be better to change the queue creation to use the new devm-managed functions. I'll do a V2 to fix it that way.