mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org, Stephen Warren <swarren@nvidia.com>
Subject: [PATCH] regmap: assume registers are volatile iff no cache
Date: Mon,  3 Jun 2013 11:34:48 -0600	[thread overview]
Message-ID: <1370280888-15072-1-git-send-email-swarren@wwwdotorg.org> (raw)

From: Stephen Warren <swarren@nvidia.com>

If a regmap has a cache, it's likely that registers are not volatile,
perhaps with exceptions. Otherwise, the cache would not be useful. Encode
this assumption into regmap_volatile()'s default return value, for the
case where a regmap doesn't specify which registers are volatile.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 drivers/base/regmap/regmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 1a01553..feb37af 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -123,7 +123,7 @@ bool regmap_volatile(struct regmap *map, unsigned int reg)
 	if (map->volatile_table)
 		return regmap_check_range_table(map, reg, map->volatile_table);
 
-	return true;
+	return (map->cache_type == REGCACHE_NONE);
 }
 
 bool regmap_precious(struct regmap *map, unsigned int reg)
-- 
1.7.10.4


             reply	other threads:[~2013-06-03 17:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03 17:34 Stephen Warren [this message]
2013-06-03 18:48 ` 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=1370280888-15072-1-git-send-email-swarren@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swarren@nvidia.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

all inboxes | Powered by JetHome®