regmap: Correct offset handling in regmap_volatile_range

commit b8f9a03b741ddfdde4aa8b607fa7d88eb63a6338 upstream.

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: f01ee60fff ("regmap: implement register striding")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
[bwh: Backported to 3.16: Use simple multiplication instead of
 regmap_get_offset()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Charles Keepax 2018-02-12 18:15:45 +00:00 committed by syphyr
parent 386afd6dc6
commit bdb397fc70
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,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 + (i * map->reg_stride)))
return false;
return true;