Skip to content

Commit b8f9a03

Browse files
charleskeepaxbroonie
authored andcommitted
regmap: Correct offset handling in regmap_volatile_range
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: f01ee60 ("regmap: implement register striding") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7928b2c commit b8f9a03

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/base/regmap/regmap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static bool regmap_volatile_range(struct regmap *map, unsigned int reg,
174174
unsigned int i;
175175

176176
for (i = 0; i < num; i++)
177-
if (!regmap_volatile(map, reg + i))
177+
if (!regmap_volatile(map, reg + regmap_get_offset(map, i)))
178178
return false;
179179

180180
return true;

0 commit comments

Comments
 (0)