diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-03-23 14:04:57 +0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-01 14:47:13 +0400 |
commit | 4b4e9e43fd210e0cd2a5d29357e7c000e13e08ae (patch) | |
tree | fe7d224017c0c6ce72751a16bf9f9b12037b248d /drivers/base/regmap/regcache-rbtree.c | |
parent | dd775ae2549217d3ae09363e3edb305d0fa19928 (diff) | |
download | linux-4b4e9e43fd210e0cd2a5d29357e7c000e13e08ae.tar.xz |
regmap: rbtree: Fix register default look-up in sync
The code currently passes the register offset in the current block to
regcache_lookup_reg. This works fine as long as there is only one block and with
base register of 0, but in all other cases it will look-up the default for a
wrong register, which can cause unnecessary register writes. This patch fixes
it by passing the actual register number to regcache_lookup_reg.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: <stable@vger.kernel.org>
Diffstat (limited to 'drivers/base/regmap/regcache-rbtree.c')
-rw-r--r-- | drivers/base/regmap/regcache-rbtree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c index 5157fa04c2f0..fb14a6343d4f 100644 --- a/drivers/base/regmap/regcache-rbtree.c +++ b/drivers/base/regmap/regcache-rbtree.c @@ -396,7 +396,7 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min, map->cache_word_size); /* Is this the hardware default? If so skip. */ - ret = regcache_lookup_reg(map, i); + ret = regcache_lookup_reg(map, regtmp); if (ret >= 0 && val == map->reg_defaults[ret].def) continue; |