summaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regcache-rbtree.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-06 00:28:49 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-06 00:49:24 +0100
commitf9353e70bcebd00cd182d946083afd7d8eddd259 (patch)
treea13460f9e9e88796067c24f0853c8a386413f022 /drivers/base/regmap/regcache-rbtree.c
parentregmap: Fix x86_64 breakage (diff)
downloadlinux-f9353e70bcebd00cd182d946083afd7d8eddd259.tar.xz
linux-f9353e70bcebd00cd182d946083afd7d8eddd259.zip
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 bae183c6bcb1..313c20f8cc28 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;