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>, Liam Girdwood <lrg@ti.com>
Subject: [PATCH 5/5] regmap: Ensure we scream if we enable cache bypass/only at the same time
Date: Tue, 27 Sep 2011 11:25:08 +0100	[thread overview]
Message-ID: <1317119108-15338-6-git-send-email-dp@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1317119108-15338-1-git-send-email-dp@opensource.wolfsonmicro.com>

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

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 2628e42..9f445bd 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -273,6 +273,8 @@ EXPORT_SYMBOL_GPL(regcache_sync);
  */
 void regcache_cache_only(struct regmap *map, bool enable)
 {
+	BUG_ON(map->cache_bypass && enable);
+
 	map->cache_only = enable;
 }
 EXPORT_SYMBOL_GPL(regcache_cache_only);
@@ -290,6 +292,8 @@ EXPORT_SYMBOL_GPL(regcache_cache_only);
  */
 void regcache_cache_bypass(struct regmap *map, bool enable)
 {
+	BUG_ON(map->cache_only && enable);
+
 	map->cache_bypass = enable;
 }
 EXPORT_SYMBOL_GPL(regcache_cache_bypass);
-- 
1.7.6.4


  parent reply	other threads:[~2011-09-27 10:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 10:25 [PATCH 0/5] regcache updates Dimitris Papastamos
2011-09-27 10:25 ` [PATCH 1/5] regmap: Fix signed/unsigned comparison Dimitris Papastamos
2011-09-27 12:27   ` Mark Brown
2011-09-27 10:25 ` [PATCH 2/5] regmap: Implement regcache_cache_bypass helper function Dimitris Papastamos
2011-09-27 19:10   ` Mark Brown
2011-09-27 10:25 ` [PATCH 3/5] regmap: Implement generic syncing functionality Dimitris Papastamos
2011-09-27 19:08   ` Mark Brown
2011-09-27 10:25 ` [PATCH 4/5] regmap: Remove redundant member `word_size' from regcache_rbtree_node Dimitris Papastamos
2011-09-27 19:07   ` Mark Brown
2011-09-27 19:08   ` Mark Brown
2011-09-27 10:25 ` Dimitris Papastamos [this message]
2011-09-27 12:28   ` [PATCH 5/5] regmap: Ensure we scream if we enable cache bypass/only at the same time 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=1317119108-15338-6-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 \
    --cc=lrg@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 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.