diff options
author | Dylan Reid <dgreid@chromium.org> | 2014-03-18 16:45:09 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-19 06:38:56 -0400 |
commit | 83f8475ce99fa1c44b03059b6cc5dcaae69b4819 (patch) | |
tree | 2328352e758b39bed089419ca9cec7a72c59643f | |
parent | 756173285e87c792c6fa8eaaaf1217cfcf1416dd (diff) |
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>
-rw-r--r-- | drivers/base/regmap/regcache.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index bb3ba42e0329..a9d8d7be6aa3 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c | |||
@@ -253,7 +253,8 @@ static int regcache_default_sync(struct regmap *map, unsigned int min, | |||
253 | unsigned int val; | 253 | unsigned int val; |
254 | int ret; | 254 | int ret; |
255 | 255 | ||
256 | if (regmap_volatile(map, reg)) | 256 | if (regmap_volatile(map, reg) || |
257 | !regmap_writeable(map, reg)) | ||
257 | continue; | 258 | continue; |
258 | 259 | ||
259 | ret = regcache_read(map, reg, &val); | 260 | ret = regcache_read(map, reg, &val); |