From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <broonie@kernel.org>
Cc: <david.rhodes@cirrus.com>, <linux-kernel@vger.kernel.org>,
<patches@opensource.cirrus.com>
Subject: [PATCH 2/4] regmap: Correct offset handling in regmap_volatile_range
Date: Mon, 12 Feb 2018 18:15:45 +0000 [thread overview]
Message-ID: <20180212181547.2415-2-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20180212181547.2415-1-ckeepax@opensource.cirrus.com>
The current implementation is broken for regmaps that have a reg_stride,
since it doesn't take the stride into account. Correct this by using the
helper function to calculate the register offset.
Fixes: f01ee60fffa4 ("regmap: implement register striding")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.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 c7b7c5fa73ab4..2339b98f1b6e4 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -174,7 +174,7 @@ static bool regmap_volatile_range(struct regmap *map, unsigned int reg,
unsigned int i;
for (i = 0; i < num; i++)
- if (!regmap_volatile(map, reg + i))
+ if (!regmap_volatile(map, reg + regmap_get_offset(map, i)))
return false;
return true;
--
2.11.0
next prev parent reply other threads:[~2018-02-12 18:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-12 18:15 [PATCH 1/4] regmap: Correct comparison in regmap_cached Charles Keepax
2018-02-12 18:15 ` Charles Keepax [this message]
2018-02-13 12:29 ` Applied "regmap: Correct offset handling in regmap_volatile_range" to the regmap tree Mark Brown
2018-02-12 18:15 ` [PATCH 3/4] regmap: Don't use format_val in regmap_bulk_read Charles Keepax
2018-02-13 12:29 ` Applied "regmap: Don't use format_val in regmap_bulk_read" to the regmap tree Mark Brown
2018-02-12 18:15 ` [PATCH 4/4] regmap: Use helper function for register offset Charles Keepax
2018-02-13 12:29 ` Applied "regmap: Use helper function for register offset" to the regmap tree Mark Brown
2018-02-13 12:29 ` Applied "regmap: Correct comparison in regmap_cached" " 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=20180212181547.2415-2-ckeepax@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=david.rhodes@cirrus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.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®