Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 330fc58b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: dapm: fix race condition in dapm"

parents 9a69bd50 dc4479fb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2164,8 +2164,10 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
{
	struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true);

	mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_PCM);
	if (!w) {
		dev_err(dapm->dev, "ASoC: DAPM unknown pin %s\n", pin);
		mutex_unlock(&dapm->card->dapm_mutex);
		return -EINVAL;
	}

@@ -2176,6 +2178,7 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
	if (status == 0)
		w->force = 0;

	mutex_unlock(&dapm->card->dapm_mutex);
	return 0;
}

@@ -3588,8 +3591,10 @@ int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
{
	struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true);

	mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_PCM);
	if (!w) {
		dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin);
		mutex_unlock(&dapm->card->dapm_mutex);
		return -EINVAL;
	}

@@ -3597,6 +3602,7 @@ int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm,
	w->connected = 1;
	w->force = 1;
	dapm_mark_dirty(w, "force enable");
	mutex_unlock(&dapm->card->dapm_mutex);

	return 0;
}