diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2014-02-18 15:22:13 +0000 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-20 19:22:23 +0900 |
commit | f6d5e586b416746664c01ab5d4b19ed5e2d1cbaa (patch) | |
tree | 4d76b984ffc8eb65631f639586bfe46f6eb29293 /include/sound/soc.h | |
parent | e96cb48482f8852716d89d0e6baf6d2c425ae33e (diff) | |
download | op-kernel-dev-f6d5e586b416746664c01ab5d4b19ed5e2d1cbaa.zip op-kernel-dev-f6d5e586b416746664c01ab5d4b19ed5e2d1cbaa.tar.gz |
ASoC: dapm: Add helpers to lock/unlock DAPM mutex
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@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | 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 9a00147..1e12b66 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1188,4 +1188,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 |