]> git.karo-electronics.de Git - linux-beck.git/commitdiff
regcache: Make sure we sync register 0 in an rbtree cache
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Mar 2012 23:31:39 +0000 (23:31 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Mar 2012 23:48:50 +0000 (23:48 +0000)
Most of the current users have register 0 as a volatile register or don't
have a register 0 so it's not been apparent that it's not getting synced.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regcache-rbtree.c

index 32620c4f16834112ab88c9f9741750aee94f26d6..861ad2c81dff580fbf309f2b6eece8f15e1d769b 100644 (file)
@@ -377,7 +377,7 @@ static int regcache_rbtree_sync(struct regmap *map)
 
                        /* Is this the hardware default?  If so skip. */
                        ret = regcache_lookup_reg(map, i);
-                       if (ret > 0 && val == map->reg_defaults[ret].def)
+                       if (ret >= 0 && val == map->reg_defaults[ret].def)
                                continue;
 
                        map->cache_bypass = 1;