aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-21 13:01:54 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-03 21:30:27 -0500
commit66baf407571662f7e2a22dd0764cbe279559446c (patch)
treea6eb3af5c0766c8ef9b105e885ae874b9806f515 /drivers/base/regmap
parent6dbe51c251a327e012439c4772097a13df43c5b8 (diff)
regmap: rbtree: Don't bother checking for noop updates
If we're updating a value in place it's more work to read the value and compare the value with what we're about to set than it is to just write the value into the cache; there are no further operations after writing in the code even though there's an early return here. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r--drivers/base/regmap/regcache-rbtree.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
index e6732cf7c06e..3f21c6ab296f 100644
--- a/drivers/base/regmap/regcache-rbtree.c
+++ b/drivers/base/regmap/regcache-rbtree.c
@@ -302,7 +302,6 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg,
302 struct regcache_rbtree_ctx *rbtree_ctx; 302 struct regcache_rbtree_ctx *rbtree_ctx;
303 struct regcache_rbtree_node *rbnode, *rbnode_tmp; 303 struct regcache_rbtree_node *rbnode, *rbnode_tmp;
304 struct rb_node *node; 304 struct rb_node *node;
305 unsigned int val;
306 unsigned int reg_tmp; 305 unsigned int reg_tmp;
307 unsigned int pos; 306 unsigned int pos;
308 int i; 307 int i;
@@ -315,10 +314,6 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg,
315 rbnode = regcache_rbtree_lookup(map, reg); 314 rbnode = regcache_rbtree_lookup(map, reg);
316 if (rbnode) { 315 if (rbnode) {
317 reg_tmp = (reg - rbnode->base_reg) / map->reg_stride; 316 reg_tmp = (reg - rbnode->base_reg) / map->reg_stride;
318 val = regcache_rbtree_get_register(rbnode, reg_tmp,
319 map->cache_word_size);
320 if (val == value)
321 return 0;
322 regcache_rbtree_set_register(rbnode, reg_tmp, value, 317 regcache_rbtree_set_register(rbnode, reg_tmp, value,
323 map->cache_word_size); 318 map->cache_word_size);
324 } else { 319 } else {