From: Dylan Reid Date: Tue, 18 Mar 2014 20:45:09 +0000 (-0700) Subject: regmap: cache: Don't attempt to sync non-writeable registers X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=83f8475ce99fa1c44b03059b6cc5dcaae69b4819;p=linux-beck.git 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 Signed-off-by: Mark Brown --- 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, 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);