regmap: cache: Step by stride in default sync
authorDylan Reid <dgreid@chromium.org>
Tue, 18 Mar 2014 20:45:08 +0000 (13:45 -0700)
committerMark Brown <broonie@linaro.org>
Wed, 19 Mar 2014 10:38:54 +0000 (10:38 +0000)
The default sync operation was still assuming a stride of one, fix it
to respect the reg_stride set in the map.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/base/regmap/regcache.c

index d4dd77134814bac1a8ba2bc91a817c1cc2002454..bb3ba42e032983e1afc5e763dc06d22389af163b 100644 (file)
@@ -249,7 +249,7 @@ static int regcache_default_sync(struct regmap *map, unsigned int min,
 {
        unsigned int reg;
 
-       for (reg = min; reg <= max; reg++) {
+       for (reg = min; reg <= max; reg += map->reg_stride) {
                unsigned int val;
                int ret;