mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dylan Reid <dgreid@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: broonie@kernel.org, Dylan Reid <dgreid@chromium.org>
Subject: [PATCH 2/2] regmap: cache: Don't attempt to sync non-writeable registers.
Date: Tue, 18 Mar 2014 13:45:09 -0700	[thread overview]
Message-ID: <1395175509-19113-2-git-send-email-dgreid@chromium.org> (raw)
In-Reply-To: <1395175509-19113-1-git-send-email-dgreid@chromium.org>

In the regcache_default_sync, if a register isn't writeable, then
_regmap_write will return an error and the rest of the sync will be
aborted.  Avoid this by checking if a register is writeable before
trying to sync it.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
---
 drivers/base/regmap/regcache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 44af125..29b4128 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -253,7 +253,8 @@ static int regcache_default_sync(struct regmap *map, unsigned int min,
 		unsigned int val;
 		int ret;
 
-		if (regmap_volatile(map, reg))
+		if (regmap_volatile(map, reg) ||
+		    !regmap_writeable(map, reg))
 			continue;
 
 		ret = regcache_read(map, reg, &val);
-- 
1.8.1.3.605.g02339dd


  reply	other threads:[~2014-03-18 20:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18 20:45 [PATCH 1/2] regmap: cache: Step by stride in default sync Dylan Reid
2014-03-18 20:45 ` Dylan Reid [this message]
2014-03-19 10:39   ` [PATCH 2/2] regmap: cache: Don't attempt to sync non-writeable registers Mark Brown
2014-03-19 10:39 ` [PATCH 1/2] regmap: cache: Step by stride in default sync 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=1395175509-19113-2-git-send-email-dgreid@chromium.org \
    --to=dgreid@chromium.org \
    --cc=broonie@kernel.org \
    --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 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®