Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83f8475c authored by Dylan Reid's avatar Dylan Reid Committed by Mark Brown
Browse files

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: default avatarDylan Reid <dgreid@chromium.org>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 75617328
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);