Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6d5e586 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown
Browse files

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: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent e96cb484
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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