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: f01ee60fff ("regmap: implement register striding")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Charles Keepax 2018-02-12 18:15:45 +00:00 committed by Mark Brown
parent 7928b2cbe5
commit b8f9a03b74
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -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;