From: Mark Brown Date: Tue, 6 Mar 2012 23:58:22 +0000 (+0000) Subject: ASoC: dapm: Only lock CODEC for I/O if not using regmap X-Git-Tag: next-20120404~32^2~3^2~45 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e06ab3b8e82c89a8ada25f61fbd9f02d6ca3103f;p=karo-tx-linux.git ASoC: dapm: Only lock CODEC for I/O if not using regmap If we do use regmap then regmap will take care of things for us. We actually already have this check at a higher level for the current users but this makes sure we do the right thing in the future too if we need to. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 1e449f375d98..dd603fa38097 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -208,7 +208,7 @@ static int soc_widget_write(struct snd_soc_dapm_widget *w, int reg, int val) static inline void soc_widget_lock(struct snd_soc_dapm_widget *w) { - if (w->codec) + if (w->codec && !w->codec->using_regmap) mutex_lock(&w->codec->mutex); else if (w->platform) mutex_lock(&w->platform->mutex); @@ -216,7 +216,7 @@ static inline void soc_widget_lock(struct snd_soc_dapm_widget *w) static inline void soc_widget_unlock(struct snd_soc_dapm_widget *w) { - if (w->codec) + if (w->codec && !w->codec->using_regmap) mutex_unlock(&w->codec->mutex); else if (w->platform) mutex_unlock(&w->platform->mutex);