regcache-rbtree: Fix reg_stride != 1
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 27 Aug 2013 11:03:03 +0000 (13:03 +0200)
committerMark Brown <broonie@linaro.org>
Tue, 27 Aug 2013 15:23:00 +0000 (16:23 +0100)
commitb6752123ccef4eec3c70c20dbdfc05d1674319c5
treeeac40c4ea69182004640ad13488c58e77c560ef8
parentd8dfad3876e4386666b759da3c833d62fb8b2267
regcache-rbtree: Fix reg_stride != 1

There are a couple of calculations, which convert between register addresses and
block indices, in regcache_rbtree_sync() and regcache_rbtree_node_alloc() which
assume that reg_stride is 1. This will break the rb cache for configurations
which do not use a reg_stride of 1.

Also rename 'base' in regcache_rbtree_sync() to 'start' to avoid confusion with
'base_reg'.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/base/regmap/regcache-rbtree.c