]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
regmap: Fix rbtree block base in sync
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Mar 2012 23:28:49 +0000 (23:28 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 5 Mar 2012 23:49:24 +0000 (23:49 +0000)
Otherwise we'll end up running with bogus register numbers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regcache-rbtree.c

index bae183c6bcb144c562dbcf36a63f51d65fb05726..313c20f8cc287085496e654e99088add64fc3918 100644 (file)
@@ -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;