mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-02 18:17:50 -04:00
ASoC: dapm: Add locking to snd_soc_dapm_xxxx_pin functions
The snd_soc_dapm_xxxx_pin all require the dapm_mutex to be held when they are called as they edit the dirty list, however very few of the callers do so. This patch adds unlocked versions of all the functions replacing the existing implementations with one that holds the lock internally. We also fix up the places where the lock was actually held on the caller side. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
This commit is contained in:
committed by
Mark Brown
parent
c4204960e9
commit
1139110064
@@ -222,27 +222,19 @@ static void arizona_extcon_pulse_micbias(struct arizona_extcon_info *info)
|
||||
struct snd_soc_dapm_context *dapm = arizona->dapm;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&dapm->card->dapm_mutex);
|
||||
|
||||
ret = snd_soc_dapm_force_enable_pin(dapm, widget);
|
||||
if (ret != 0)
|
||||
dev_warn(arizona->dev, "Failed to enable %s: %d\n",
|
||||
widget, ret);
|
||||
|
||||
mutex_unlock(&dapm->card->dapm_mutex);
|
||||
|
||||
snd_soc_dapm_sync(dapm);
|
||||
|
||||
if (!arizona->pdata.micd_force_micbias) {
|
||||
mutex_lock(&dapm->card->dapm_mutex);
|
||||
|
||||
ret = snd_soc_dapm_disable_pin(arizona->dapm, widget);
|
||||
if (ret != 0)
|
||||
dev_warn(arizona->dev, "Failed to disable %s: %d\n",
|
||||
widget, ret);
|
||||
|
||||
mutex_unlock(&dapm->card->dapm_mutex);
|
||||
|
||||
snd_soc_dapm_sync(dapm);
|
||||
}
|
||||
}
|
||||
@@ -304,16 +296,12 @@ static void arizona_stop_mic(struct arizona_extcon_info *info)
|
||||
ARIZONA_MICD_ENA, 0,
|
||||
&change);
|
||||
|
||||
mutex_lock(&dapm->card->dapm_mutex);
|
||||
|
||||
ret = snd_soc_dapm_disable_pin(dapm, widget);
|
||||
if (ret != 0)
|
||||
dev_warn(arizona->dev,
|
||||
"Failed to disable %s: %d\n",
|
||||
widget, ret);
|
||||
|
||||
mutex_unlock(&dapm->card->dapm_mutex);
|
||||
|
||||
snd_soc_dapm_sync(dapm);
|
||||
|
||||
if (info->micd_reva) {
|
||||
|
||||
Reference in New Issue
Block a user