public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: broonie@kernel.org
Cc: myungjoo.ham@samsung.com, cw00.choi@samsung.com,
	dmitry.torokhov@gmail.com, lgirdwood@gmail.com, lars@metafoo.de,
	peter.ujfalusi@ti.com, jarkko.nikula@bitmer.com,
	eric.y.miao@gmail.com, haojian.zhuang@gmail.com,
	linux-kernel@vger.kernel.org,
	patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org,
	linux@arm.linux.org.uk
Subject: [PATCH 02/17 v2] ASoC: dapm: Add helpers to lock/unlock DAPM mutex
Date: Tue, 18 Feb 2014 15:22:13 +0000	[thread overview]
Message-ID: <1392736948-26623-3-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1392736948-26623-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>

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>
---
 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


  parent reply	other threads:[~2014-02-18 15:37 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 15:22 [PATCH 00/17 v2] Update locking for snd_soc_dapm_xxxx_pin functions Charles Keepax
2014-02-18 15:22 ` [PATCH 01/17 v2] Input - arizona-haptics: Fix double lock of dapm_mutex Charles Keepax
2014-02-20  3:54   ` Mark Brown
2014-02-20  4:20     ` Dmitry Torokhov
2014-02-20  9:12   ` Mark Brown
2014-02-18 15:22 ` Charles Keepax [this message]
2014-02-20 10:23   ` [PATCH 02/17 v2] ASoC: dapm: Add helpers to lock/unlock DAPM mutex Mark Brown
2014-02-18 15:22 ` [PATCH 03/17 v2] ASoC: dapm: Add locking to snd_soc_dapm_xxxx_pin functions Charles Keepax
2014-02-20  9:40   ` Mark Brown
2014-02-18 15:22 ` [PATCH 04/17 v2] ASoC: dapm: Add unlocked version of snd_soc_dapm_sync Charles Keepax
2014-02-18 16:14   ` Lars-Peter Clausen
2014-02-19  3:28     ` Mark Brown
2014-02-20 10:24   ` Mark Brown
2014-02-18 15:22 ` [PATCH 05/17 v2] ASoC: adav80x: Update locking around use of DAPM pin API Charles Keepax
2014-02-18 16:12   ` Lars-Peter Clausen
2014-02-20 10:25   ` Mark Brown
2014-02-18 15:22 ` [PATCH 06/17 v2] ASoC: wm5100: " Charles Keepax
2014-02-20 10:26   ` Mark Brown
2014-02-18 15:22 ` [PATCH 07/17 v2] ASoC: wm8962: " Charles Keepax
2014-02-20 10:26   ` Mark Brown
2014-02-18 15:22 ` [PATCH 08/17 v2] ASoC: wm8994: " Charles Keepax
2014-02-20 10:26   ` Mark Brown
2014-02-18 15:22 ` [PATCH 09/17 v2] ASoC: wm8996: " Charles Keepax
2014-02-20 10:27   ` Mark Brown
2014-02-18 15:22 ` [PATCH 10/17 v2] ASoC: mfld_machine: " Charles Keepax
2014-02-20 10:27   ` Mark Brown
2014-02-18 15:22 ` [PATCH 11/17 v2] ASoC: ams-delta: " Charles Keepax
2014-02-20 10:27   ` Mark Brown
2014-02-18 15:22 ` [PATCH 12/17 v2] ASoC: omap: n810: " Charles Keepax
2014-02-20 10:28   ` Mark Brown
2014-02-18 15:22 ` [PATCH 13/17 v2] ASoC: omap: rx51: " Charles Keepax
2014-02-20 10:28   ` Mark Brown
2014-02-18 15:22 ` [PATCH 14/17 v2] ASoC: pxa: corgi: " Charles Keepax
2014-02-20 10:53   ` Mark Brown
2014-02-18 15:22 ` [PATCH 15/17 v2] ASoC: pxa: magician: " Charles Keepax
2014-02-20 10:54   ` Mark Brown
2014-02-18 15:22 ` [PATCH 16/17 v2] ASoC: pxa: spitz: " Charles Keepax
2014-02-20 10:54   ` Mark Brown
2014-02-18 15:22 ` [PATCH 17/17 v2] ASoC: pxa: tosa: " Charles Keepax
2014-02-20 10:54   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392736948-26623-3-git-send-email-ckeepax@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cw00.choi@samsung.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=eric.y.miao@gmail.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=jarkko.nikula@bitmer.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=myungjoo.ham@samsung.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=peter.ujfalusi@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox