Skip to contentSkip to conversation

regmap: Allow rbtree to cache zero default values

PATCH New Mark Brown 1 participant 1 message Oct 9, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 regmap: Allow rbtree to cache zero default values

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.

---
 drivers/base/regmap/regcache-rbtree.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/base/regmap/regcache-rbtree.c +0 -3
index e04e36e..e314984 100644
@@ -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)) {
Signature · 1 line
1.7.6.3