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)
committerVarun Wadekar <vwadekar@nvidia.com>
Wed, 18 Apr 2012 05:36:11 +0000 (10:36 +0530)
commitb71c03b6ed2d3c2e01f10190f3096fe4351bd1f7
tree52a9669902d417991830dc6aea099b8025e91d86
parent252e5813daed319397a892ae8fdf37993a0db327
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