aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regcache-rbtree.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-05 23:28:49 +0000
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-05 23:49:24 +0000
commitf9353e70bcebd00cd182d946083afd7d8eddd259 (patch)
treea13460f9e9e88796067c24f0853c8a386413f022 /drivers/base/regmap/regcache-rbtree.c
parenta0941e562e8008804f9fe4400315ceb164752fac (diff)
downloadkernel_goldelico_gta04-f9353e70bcebd00cd182d946083afd7d8eddd259.zip
kernel_goldelico_gta04-f9353e70bcebd00cd182d946083afd7d8eddd259.tar.gz
kernel_goldelico_gta04-f9353e70bcebd00cd182d946083afd7d8eddd259.tar.bz2
regmap: Fix rbtree block base in sync
Otherwise we'll end up running with bogus register numbers. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base/regmap/regcache-rbtree.c')
-rw-r--r--drivers/base/regmap/regcache-rbtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
index bae183c..313c20f 100644
--- a/drivers/base/regmap/regcache-rbtree.c
+++ b/drivers/base/regmap/regcache-rbtree.c
@@ -379,7 +379,7 @@ static int regcache_rbtree_sync(struct regmap *map, unsigned int min,
if (rbnode->base_reg + rbnode->blklen < min)
continue;
- if (min < rbnode->base_reg + rbnode->blklen)
+ if (min > rbnode->base_reg)
base = min - rbnode->base_reg;
else
base = 0;