regmap: rbtree: Fix register default look-up in sync
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 23 Mar 2012 10:04:57 +0000 (11:04 +0100)
committerSimone Willett <swillett@nvidia.com>
Sun, 15 Apr 2012 20:56:17 +0000 (13:56 -0700)
commit444264a5219523b112929d523918c25469cf695c
treecac1366029078271144a8bb478cc297dbeca6939
parent7c71eb935905d8181a34218f33ac5f49d2a0db65
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>
(cherry picked from commit 4b4e9e43fd210e0cd2a5d29357e7c000e13e08ae)

Change-Id: Ibed70828471423df5432fea67316ca9ad8aeb52a
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/96497
Reviewed-by: Automatic_Commit_Validation_User
drivers/base/regmap/regcache-rbtree.c