Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Mark Brown <broonie@linaro.org>

authored by

Dylan Reid and committed by
Mark Brown
83f8475c 75617328

+2 -1
+2 -1
drivers/base/regmap/regcache.c
··· 253 253 unsigned int val; 254 254 int ret; 255 255 256 - if (regmap_volatile(map, reg)) 256 + if (regmap_volatile(map, reg) || 257 + !regmap_writeable(map, reg)) 257 258 continue; 258 259 259 260 ret = regcache_read(map, reg, &val);