regmap: Allow rbtree to cache zero default values
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 9 Oct 2011 13:30:02 +0000 (14:30 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 10 Oct 2011 09:25:00 +0000 (10:25 +0100)
Ensure that when we start up in cache only mode we can store defaults of
zero, otherwise if the hardware is unavailable we won't be able to read.

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

index 887dbce..52511f9 100644 (file)
@@ -252,9 +252,6 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg,
                regcache_rbtree_set_register(rbnode, reg_tmp, value,
                                             map->cache_word_size);
        } else {
-               /* bail out early, no need to create the rbnode yet */
-               if (!value)
-                       return 0;
                /* look for an adjacent register to the one we are about to add */
                for (node = rb_first(&rbtree_ctx->root); node;
                     node = rb_next(node)) {