regmap: cache: Step by stride in default sync.
Subsystems (2)
PATCH 1/2 regmap: cache: Step by stride in default sync.
The default sync operation was still assuming a stride of one, fix it to respect the reg_stride set in the map.
--- drivers/base/regmap/regcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regcache.c +1 -1
@@ -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;
Signature · 1 line
1.8.1.3.605.g02339dd
PATCH 2/2 regmap: cache: Don't attempt to sync non-writeable registers.
In the regcache_default_sync, if a register isn't writeable, then _regmap_write will return an error and the rest of the sync will be aborted. Avoid this by checking if a register is writeable before trying to sync it.
--- drivers/base/regmap/regcache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/base/regmap/regcache.c +2 -1
@@ -253,7 +253,8 @@ static int regcache_default_sync(struct regmap *map, unsigned int min,unsigned int val;int ret; -if (regmap_volatile (map, reg)) +if (regmap_volatile (map, reg) || + !regmap_writeable (map, reg))continue ; ret =regcache_read (map, reg, &val);
Signature · 1 line
1.8.1.3.605.g02339dd
Re: [PATCH 2/2] regmap: cache: Don't attempt to sync non-writeable registers.
Quoted 4 lines · Dylan Reid
In the
regcache_default_sync, if a register isn't writeable, then_regmap_writewill return an error and the rest of the sync will be aborted. Avoid this by checking if a register is writeable before trying to sync it.
Applied, thanks.
Quoted 2 lines · Dylan Reid
The default sync operation was still assuming a stride of one, fix it to respect the
reg_strideset in the map.
Applied, thanks.