[PATCH 02/17 v2] ASoC: dapm: Add helpers to lock/unlock DAPM mutex

From: Charles Keepax
Date: Tue Feb 18 2014 - 10:37:26 EST


Acquiring the DAPM mutex is necessary before using several DAPM
functions and dereference is quite ugly. This patch provides a helper
function to simplify this.

Signed-off-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
---
include/sound/soc.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 21038e0..dc46623 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1204,4 +1204,15 @@ extern struct dentry *snd_soc_debugfs_root;

extern const struct dev_pm_ops snd_soc_pm_ops;

+/* Helper functions */
+static inline void snd_soc_dapm_mutex_lock(struct snd_soc_dapm_context *dapm)
+{
+ mutex_lock(&dapm->card->dapm_mutex);
+}
+
+static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm)
+{
+ mutex_unlock(&dapm->card->dapm_mutex);
+}
+
#endif
--
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/