Unverified Commit 5776bcdf authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: cs35l56: Fixes for driver cleanup

Richard Fitzgerald <rf@opensource.cirrus.com> says:

Two patches to fix cleanup during driver remove() and the error path
of probe().

The main purpose is to fix cleanup of the workqueue.
parents 027ef9a9 fd4d83e1
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1956,7 +1956,7 @@ int cs35l56_common_probe(struct cs35l56_private *cs35l56)
		goto err;
	}

	ret = devm_snd_soc_register_component(cs35l56->base.dev,
	ret = snd_soc_register_component(cs35l56->base.dev,
					 &soc_component_dev_cs35l56,
					 cs35l56_dai, ARRAY_SIZE(cs35l56_dai));
	if (ret < 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");
@@ -2057,6 +2060,8 @@ EXPORT_SYMBOL_NS_GPL(cs35l56_init, "SND_SOC_CS35L56_CORE");

void cs35l56_remove(struct cs35l56_private *cs35l56)
{
	snd_soc_unregister_component(cs35l56->base.dev);

	cs35l56->base.init_done = false;

	/*