All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 4/4] regmap: Ensure we scream if we enable cache bypass/only at the same time
Date: Thu, 29 Sep 2011 14:36:28 +0100	[thread overview]
Message-ID: <1317303388-4040-4-git-send-email-dp@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1317303388-4040-1-git-send-email-dp@opensource.wolfsonmicro.com>

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 drivers/base/regmap/regcache.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index eaa2e20..1d07828 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -281,6 +281,7 @@ EXPORT_SYMBOL_GPL(regcache_sync);
 void regcache_cache_only(struct regmap *map, bool enable)
 {
 	mutex_lock(&map->lock);
+	WARN_ON(map->cache_bypass && enable);
 	map->cache_only = enable;
 	mutex_unlock(&map->lock);
 }
@@ -300,6 +301,7 @@ EXPORT_SYMBOL_GPL(regcache_cache_only);
 void regcache_cache_bypass(struct regmap *map, bool enable)
 {
 	mutex_lock(&map->lock);
+	WARN_ON(map->cache_only && enable);
 	map->cache_bypass = enable;
 	mutex_unlock(&map->lock);
 }
-- 
1.7.6.4


  parent reply	other threads:[~2011-09-29 13:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29 13:36 [PATCH 1/4] regmap: Lock the sync path, ensure we use the lockless _regmap_write() Dimitris Papastamos
2011-09-29 13:36 ` [PATCH 2/4] regmap: Save/restore the bypass state upon syncing Dimitris Papastamos
2011-09-29 13:36 ` [PATCH 3/4] regmap: Implement regcache_cache_bypass helper function Dimitris Papastamos
2011-09-29 13:36 ` Dimitris Papastamos [this message]
2011-09-30 12:58 ` [PATCH 1/4] regmap: Lock the sync path, ensure we use the lockless _regmap_write() 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=1317303388-4040-4-git-send-email-dp@opensource.wolfsonmicro.com \
    --to=dp@opensource.wolfsonmicro.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.