Skip to content

Commit

Permalink
regmap: Fix rbtree block base in sync
Browse files Browse the repository at this point in the history
Otherwise we'll end up running with bogus register numbers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Mar 5, 2012
1 parent a0941e5 commit f9353e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/regmap/regcache-rbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f9353e7

Please sign in to comment.