]> git.baikalelectronics.ru Git - kernel.git/commit
regmap: cache Fix regcache-rbtree sync
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 13 Mar 2013 15:38:33 +0000 (16:38 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 13 Mar 2013 19:07:19 +0000 (19:07 +0000)
commitdc9ad8103ced1e1d353b93dcd49a3e0cc25b3d62
tree2dd6b08be88285262f3a3027c0ba40872e62124e
parent025d7a061973fce562117d8afddd51b81bc911f1
regmap: cache Fix regcache-rbtree sync

The last register block, which falls into the specified range, is not handled
correctly. The formula which calculates the number of register which should be
synced is inverse (and off by one). E.g. if all registers in that block should
be synced only one is synced, and if only one should be synced all (but one) are
synced. To calculate the number of registers that need to be synced we need to
subtract the number of the first register in the block from the max register
number and add one. This patch updates the code accordingly.

The issue was introduced in commit 5b01bad ("regmap: Supply ranges to the sync
operations").

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
drivers/base/regmap/regcache-rbtree.c