Commit 66baf407 authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 6dbe51c2
...@@ -302,7 +302,6 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg, ...@@ -302,7 +302,6 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg,
struct regcache_rbtree_ctx *rbtree_ctx; struct regcache_rbtree_ctx *rbtree_ctx;
struct regcache_rbtree_node *rbnode, *rbnode_tmp; struct regcache_rbtree_node *rbnode, *rbnode_tmp;
struct rb_node *node; struct rb_node *node;
unsigned int val;
unsigned int reg_tmp; unsigned int reg_tmp;
unsigned int pos; unsigned int pos;
int i; int i;
...@@ -315,10 +314,6 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg, ...@@ -315,10 +314,6 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg,
rbnode = regcache_rbtree_lookup(map, reg); rbnode = regcache_rbtree_lookup(map, reg);
if (rbnode) { if (rbnode) {
reg_tmp = (reg - rbnode->base_reg) / map->reg_stride; reg_tmp = (reg - rbnode->base_reg) / map->reg_stride;
val = regcache_rbtree_get_register(rbnode, reg_tmp,
map->cache_word_size);
if (val == value)
return 0;
regcache_rbtree_set_register(rbnode, reg_tmp, value, regcache_rbtree_set_register(rbnode, reg_tmp, value,
map->cache_word_size); map->cache_word_size);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment