From: Charles Keepax Date: Tue, 18 Feb 2014 15:22:13 +0000 (+0000) Subject: ASoC: dapm: Add helpers to lock/unlock DAPM mutex X-Git-Tag: submit/tizen/20160607.132125~4775^2~1^2~5^2~13^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6d5e586b416746664c01ab5d4b19ed5e2d1cbaa;p=sdk%2Femulator%2Femulator-kernel.git 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 Signed-off-by: Mark Brown --- 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