Parcourir la source

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: f01ee60fffa4 ("regmap: implement register striding")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax il y a 7 ans
Parent
commit
b8f9a03b74
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      drivers/base/regmap/regmap.c

+ 1 - 1
drivers/base/regmap/regmap.c

@@ -174,7 +174,7 @@ static bool regmap_volatile_range(struct regmap *map, unsigned int reg,
 	unsigned int i;
 	unsigned int i;
 
 
 	for (i = 0; i < num; 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 false;
 
 
 	return true;
 	return true;