Commit c4204960 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

Input - arizona-haptics: Fix double lock of dapm_mutex

snd_soc_dapm_sync takes the dapm_mutex internally, but we currently take
it externally as well. This patch fixes this.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
parent 30686c35
...@@ -77,16 +77,14 @@ static void arizona_haptics_work(struct work_struct *work) ...@@ -77,16 +77,14 @@ static void arizona_haptics_work(struct work_struct *work)
return; return;
} }
mutex_unlock(dapm_mutex);
ret = snd_soc_dapm_sync(arizona->dapm); ret = snd_soc_dapm_sync(arizona->dapm);
if (ret != 0) { if (ret != 0) {
dev_err(arizona->dev, "Failed to sync DAPM: %d\n", dev_err(arizona->dev, "Failed to sync DAPM: %d\n",
ret); ret);
mutex_unlock(dapm_mutex);
return; return;
} }
mutex_unlock(dapm_mutex);
} else { } else {
/* This disable sequence will be a noop if already enabled */ /* This disable sequence will be a noop if already enabled */
mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); mutex_lock_nested(dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
...@@ -99,16 +97,15 @@ static void arizona_haptics_work(struct work_struct *work) ...@@ -99,16 +97,15 @@ static void arizona_haptics_work(struct work_struct *work)
return; return;
} }
mutex_unlock(dapm_mutex);
ret = snd_soc_dapm_sync(arizona->dapm); ret = snd_soc_dapm_sync(arizona->dapm);
if (ret != 0) { if (ret != 0) {
dev_err(arizona->dev, "Failed to sync DAPM: %d\n", dev_err(arizona->dev, "Failed to sync DAPM: %d\n",
ret); ret);
mutex_unlock(dapm_mutex);
return; return;
} }
mutex_unlock(dapm_mutex);
ret = regmap_update_bits(arizona->regmap, ret = regmap_update_bits(arizona->regmap,
ARIZONA_HAPTICS_CONTROL_1, ARIZONA_HAPTICS_CONTROL_1,
ARIZONA_HAP_CTRL_MASK, ARIZONA_HAP_CTRL_MASK,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment